diff options
| author | oxalica <oxalicc@pm.me> | 2019-11-16 03:44:38 +0800 |
|---|---|---|
| committer | oxalica <oxalicc@pm.me> | 2019-11-16 03:44:38 +0800 |
| commit | 4c175fbe8a7bb899b6e32994b96d4f3389c1dccc (patch) | |
| tree | 212232d5960f0fb7803ab2edc9c5aff3c3c1913e /editors/code/src | |
| parent | 503920532d8e3b76e17cf534164655d23c9c3c5d (diff) | |
| download | rust-4c175fbe8a7bb899b6e32994b96d4f3389c1dccc.tar.gz rust-4c175fbe8a7bb899b6e32994b96d4f3389c1dccc.zip | |
Check exit code of `cargo watch`
Diffstat (limited to 'editors/code/src')
| -rw-r--r-- | editors/code/src/commands/runnables.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts index 39e542fb6cf..93171bc757f 100644 --- a/editors/code/src/commands/runnables.ts +++ b/editors/code/src/commands/runnables.ts @@ -161,7 +161,7 @@ export async function startCargoWatch( ): Promise<CargoWatchProvider | undefined> { const execPromise = util.promisify(child_process.exec); - const { stderr } = await execPromise('cargo watch --version').catch(e => e); + const { stderr, code = 0 } = await execPromise('cargo watch --version').catch(e => e); if (stderr.includes('no such subcommand: `watch`')) { const msg = @@ -201,9 +201,9 @@ export async function startCargoWatch( ); return; } - } else if (stderr !== '') { + } else if (code !== 0) { vscode.window.showErrorMessage( - `Couldn't run \`cargo watch\`: ${stderr}` + `\`cargo watch\` failed with ${code}: ${stderr}` ); return; } |
