diff --git a/bin/pact-broker.ts b/bin/pact-broker.ts index aa7bed46..2927c077 100644 --- a/bin/pact-broker.ts +++ b/bin/pact-broker.ts @@ -3,11 +3,13 @@ import childProcess = require('child_process'); import rubyStandalone from '../src/pact-standalone'; -const { status } = childProcess.spawnSync( +const { error, status } = childProcess.spawnSync( rubyStandalone.brokerFullPath, process.argv.slice(2), { stdio: 'inherit', + shell: true, } ); +if (error) throw error; process.exit(status as number); diff --git a/bin/pact-message.ts b/bin/pact-message.ts index c31a54ec..aae607ae 100644 --- a/bin/pact-message.ts +++ b/bin/pact-message.ts @@ -3,11 +3,13 @@ import childProcess = require('child_process'); import rubyStandalone from '../src/pact-standalone'; -const { status } = childProcess.spawnSync( +const { error, status } = childProcess.spawnSync( rubyStandalone.messageFullPath, process.argv.slice(2), { stdio: 'inherit', + shell: true, } ); +if (error) throw error; process.exit(status as number); diff --git a/bin/pact-mock-service.ts b/bin/pact-mock-service.ts index 15e279e0..f4967f26 100644 --- a/bin/pact-mock-service.ts +++ b/bin/pact-mock-service.ts @@ -3,9 +3,13 @@ import childProcess = require('child_process'); import rubyStandalone from '../src/pact-standalone'; -const { status } = childProcess.spawnSync( +const { error, status } = childProcess.spawnSync( rubyStandalone.mockServiceFullPath, process.argv.slice(2), - { stdio: 'inherit' } + { + stdio: 'inherit', + shell: true, + } ); +if (error) throw error; process.exit(status as number); diff --git a/bin/pact-provider-verifier.ts b/bin/pact-provider-verifier.ts index 3d4b7dab..b4152fc6 100644 --- a/bin/pact-provider-verifier.ts +++ b/bin/pact-provider-verifier.ts @@ -3,11 +3,13 @@ import childProcess = require('child_process'); import rubyStandalone from '../src/pact-standalone'; -const { status } = childProcess.spawnSync( +const { error, status } = childProcess.spawnSync( rubyStandalone.verifierFullPath, process.argv.slice(2), { stdio: 'inherit', + shell: true, } ); +if (error) throw error; process.exit(status as number); diff --git a/bin/pact-stub-service.ts b/bin/pact-stub-service.ts index c565efae..690a9c49 100644 --- a/bin/pact-stub-service.ts +++ b/bin/pact-stub-service.ts @@ -3,11 +3,13 @@ import childProcess = require('child_process'); import rubyStandalone from '../src/pact-standalone'; -const { status } = childProcess.spawnSync( +const { error, status } = childProcess.spawnSync( rubyStandalone.stubFullPath, process.argv.slice(2), { stdio: 'inherit', + shell: true, } ); +if (error) throw error; process.exit(status as number); diff --git a/bin/pact.ts b/bin/pact.ts index 34e5553f..3c51100e 100644 --- a/bin/pact.ts +++ b/bin/pact.ts @@ -3,11 +3,13 @@ import childProcess = require('child_process'); import rubyStandalone from '../src/pact-standalone'; -const { status } = childProcess.spawnSync( +const { error, status } = childProcess.spawnSync( rubyStandalone.pactFullPath, process.argv.slice(2), { stdio: 'inherit', + shell: true, } ); +if (error) throw error; process.exit(status as number); diff --git a/bin/pactflow.ts b/bin/pactflow.ts index 707158b6..afde93a4 100644 --- a/bin/pactflow.ts +++ b/bin/pactflow.ts @@ -3,11 +3,13 @@ import childProcess = require('child_process'); import rubyStandalone from '../src/pact-standalone'; -const { status } = childProcess.spawnSync( +const { error, status } = childProcess.spawnSync( rubyStandalone.pactflowFullPath, process.argv.slice(2), { stdio: 'inherit', + shell: true, } ); +if (error) throw error; process.exit(status as number);