Appease CI

This commit is contained in:
Igor Matuszewski 2019-03-18 22:51:01 +01:00
parent 7c2595c268
commit 34b428cc5e

View file

@ -1,4 +1,4 @@
import { exec } from 'child_process'; import * as child_process from 'child_process';
import * as util from 'util'; import * as util from 'util';
import * as vscode from 'vscode'; import * as vscode from 'vscode';
import * as lc from 'vscode-languageclient'; import * as lc from 'vscode-languageclient';
@ -157,7 +157,7 @@ export async function interactivelyStartCargoWatch() {
return; return;
} }
const execAsync = util.promisify(exec); const execPromise = util.promisify(child_process.exec);
const watch = await vscode.window.showInformationMessage( const watch = await vscode.window.showInformationMessage(
'Start watching changes with cargo? (Executes `cargo watch`, provides inline diagnostics)', 'Start watching changes with cargo? (Executes `cargo watch`, provides inline diagnostics)',
@ -168,7 +168,7 @@ export async function interactivelyStartCargoWatch() {
return; return;
} }
const { stderr } = await execAsync('cargo watch --version').catch(e => e); const { stderr } = await execPromise('cargo watch --version').catch(e => e);
if (stderr.includes('no such subcommand: `watch`')) { if (stderr.includes('no such subcommand: `watch`')) {
const msg = const msg =
'The `cargo-watch` subcommand is not installed. Install? (takes ~1-2 minutes)'; 'The `cargo-watch` subcommand is not installed. Install? (takes ~1-2 minutes)';
@ -183,7 +183,7 @@ export async function interactivelyStartCargoWatch() {
const label = 'install-cargo-watch'; const label = 'install-cargo-watch';
const taskFinished = new Promise((resolve, reject) => { const taskFinished = new Promise((resolve, reject) => {
let disposable = vscode.tasks.onDidEndTask(({ execution }) => { const disposable = vscode.tasks.onDidEndTask(({ execution }) => {
if (execution.task.name === label) { if (execution.task.name === label) {
disposable.dispose(); disposable.dispose();
resolve(); resolve();
@ -200,12 +200,10 @@ export async function interactivelyStartCargoWatch() {
}) })
); );
await taskFinished; await taskFinished;
const { stderr } = await execAsync('cargo watch --version').catch( const output = await execPromise('cargo watch --version').catch(e => e);
e => e if (output.stderr !== '') {
);
if (stderr !== '') {
vscode.window.showErrorMessage( vscode.window.showErrorMessage(
`Couldn't install \`cargo-\`watch: ${stderr}` `Couldn't install \`cargo-\`watch: ${output.stderr}`
); );
return; return;
} }