Skip to content

Commit

Permalink
fix: shell escaping on non windows platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed May 28, 2024
1 parent 3515c11 commit d5ec9ea
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
4 changes: 3 additions & 1 deletion bin/pact-broker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import childProcess = require('child_process');
import rubyStandalone from '../src/pact-standalone';

const isWindows = process.platform === 'win32'
const opts = isWindows ? { shell: true } : {}
const { error, status } = childProcess.spawnSync(
rubyStandalone.brokerFullPath,
process.argv.slice(2),
{
stdio: 'inherit',
shell: true,
...opts
}
);
if (error) throw error;
Expand Down
4 changes: 3 additions & 1 deletion bin/pact-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import childProcess = require('child_process');
import rubyStandalone from '../src/pact-standalone';

const isWindows = process.platform === 'win32'
const opts = isWindows ? { shell: true } : {}
const { error, status } = childProcess.spawnSync(
rubyStandalone.messageFullPath,
process.argv.slice(2),
{
stdio: 'inherit',
shell: true,
...opts
}
);
if (error) throw error;
Expand Down
4 changes: 3 additions & 1 deletion bin/pact-mock-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import childProcess = require('child_process');
import rubyStandalone from '../src/pact-standalone';

const isWindows = process.platform === 'win32'
const opts = isWindows ? { shell: true } : {}
const { error, status } = childProcess.spawnSync(
rubyStandalone.mockServiceFullPath,
process.argv.slice(2),
{
stdio: 'inherit',
shell: true,
...opts
}
);
if (error) throw error;
Expand Down
4 changes: 3 additions & 1 deletion bin/pact-provider-verifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import childProcess = require('child_process');
import rubyStandalone from '../src/pact-standalone';

const isWindows = process.platform === 'win32'
const opts = isWindows ? { shell: true } : {}
const { error, status } = childProcess.spawnSync(
rubyStandalone.verifierFullPath,
process.argv.slice(2),
{
stdio: 'inherit',
shell: true,
...opts
}
);
if (error) throw error;
Expand Down
4 changes: 3 additions & 1 deletion bin/pact-stub-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import childProcess = require('child_process');
import rubyStandalone from '../src/pact-standalone';

const isWindows = process.platform === 'win32'
const opts = isWindows ? { shell: true } : {}
const { error, status } = childProcess.spawnSync(
rubyStandalone.stubFullPath,
process.argv.slice(2),
{
stdio: 'inherit',
shell: true,
...opts
}
);
if (error) throw error;
Expand Down
4 changes: 3 additions & 1 deletion bin/pact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import childProcess = require('child_process');
import rubyStandalone from '../src/pact-standalone';

const isWindows = process.platform === 'win32'
const opts = isWindows ? { shell: true } : {}
const { error, status } = childProcess.spawnSync(
rubyStandalone.pactFullPath,
process.argv.slice(2),
{
stdio: 'inherit',
shell: true,
...opts
}
);
if (error) throw error;
Expand Down
4 changes: 3 additions & 1 deletion bin/pactflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import childProcess = require('child_process');
import rubyStandalone from '../src/pact-standalone';

const isWindows = process.platform === 'win32'
const opts = isWindows ? { shell: true } : {}
const { error, status } = childProcess.spawnSync(
rubyStandalone.pactflowFullPath,
process.argv.slice(2),
{
stdio: 'inherit',
shell: true,
...opts
}
);
if (error) throw error;
Expand Down

0 comments on commit d5ec9ea

Please sign in to comment.