diff options
author | oxalica <[email protected]> | 2019-11-15 19:44:38 +0000 |
---|---|---|
committer | oxalica <[email protected]> | 2019-11-15 19:44:38 +0000 |
commit | 4c175fbe8a7bb899b6e32994b96d4f3389c1dccc (patch) | |
tree | 212232d5960f0fb7803ab2edc9c5aff3c3c1913e /editors | |
parent | 503920532d8e3b76e17cf534164655d23c9c3c5d (diff) |
Check exit code of `cargo watch`
Diffstat (limited to 'editors')
-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 39e542fb6..93171bc75 100644 --- a/editors/code/src/commands/runnables.ts +++ b/editors/code/src/commands/runnables.ts | |||
@@ -161,7 +161,7 @@ export async function startCargoWatch( | |||
161 | ): Promise<CargoWatchProvider | undefined> { | 161 | ): Promise<CargoWatchProvider | undefined> { |
162 | const execPromise = util.promisify(child_process.exec); | 162 | const execPromise = util.promisify(child_process.exec); |
163 | 163 | ||
164 | const { stderr } = await execPromise('cargo watch --version').catch(e => e); | 164 | const { stderr, code = 0 } = await execPromise('cargo watch --version').catch(e => e); |
165 | 165 | ||
166 | if (stderr.includes('no such subcommand: `watch`')) { | 166 | if (stderr.includes('no such subcommand: `watch`')) { |
167 | const msg = | 167 | const msg = |
@@ -201,9 +201,9 @@ export async function startCargoWatch( | |||
201 | ); | 201 | ); |
202 | return; | 202 | return; |
203 | } | 203 | } |
204 | } else if (stderr !== '') { | 204 | } else if (code !== 0) { |
205 | vscode.window.showErrorMessage( | 205 | vscode.window.showErrorMessage( |
206 | `Couldn't run \`cargo watch\`: ${stderr}` | 206 | `\`cargo watch\` failed with ${code}: ${stderr}` |
207 | ); | 207 | ); |
208 | return; | 208 | return; |
209 | } | 209 | } |