From 9c27906dab6bb93b6843f5c679128f6781cc3f3c Mon Sep 17 00:00:00 2001 From: Sam Verschueren Date: Wed, 28 Dec 2016 20:31:26 +0100 Subject: [PATCH] process feedback --- index.js | 2 +- readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index d4a0d35056..3932510e85 100644 --- a/index.js +++ b/index.js @@ -232,7 +232,7 @@ module.exports.sync = (cmd, args, opts) => { const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts); if (result.error || result.status !== 0) { - throw result.error || new Error(result.stdout === '' ? result.stderr : result.stdout); + throw (result.error || new Error(result.stdout === '' ? result.stderr : result.stdout)); } result.stdout = handleOutput(parsed.opts, result.stdout); diff --git a/readme.md b/readme.md index 6f08508a0c..f0ba9000b2 100644 --- a/readme.md +++ b/readme.md @@ -95,7 +95,7 @@ Same options as [`child_process.execFileSync`](https://nodejs.org/api/child_proc Returns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options). -This method throws an `Error` if something is written to `stderr`. +This method throws an `Error` if the command fails. ### execa.shellSync(file, [options])