Skip to content

Commit edd216e

Browse files
committed
Gulp task detection shouldn't open output
Fixes microsoft#64900
1 parent d13f20e commit edd216e

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

extensions/gulp/src/main.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import * as path from 'path';
77
import * as fs from 'fs';
88
import * as cp from 'child_process';
99
import * as vscode from 'vscode';
10-
1110
import * as nls from 'vscode-nls';
11+
1212
const localize = nls.loadMessageBundle();
1313

1414
type AutoDetect = 'on' | 'off';
@@ -60,6 +60,13 @@ function getOutputChannel(): vscode.OutputChannel {
6060
return _channel;
6161
}
6262

63+
function showError() {
64+
vscode.window.showWarningMessage(localize('gulpTaskDetectError', 'Problem finding gulp tasks. See the output for more information.'),
65+
localize('gulpShowOutput', 'Go to output')).then(() => {
66+
_channel.show(true);
67+
});
68+
}
69+
6370
interface GulpTaskDefinition extends vscode.TaskDefinition {
6471
task: string;
6572
file?: string;
@@ -125,7 +132,7 @@ class FolderDetector {
125132
let { stdout, stderr } = await exec(commandLine, { cwd: rootPath });
126133
if (stderr && stderr.length > 0) {
127134
getOutputChannel().appendLine(stderr);
128-
getOutputChannel().show(true);
135+
showError();
129136
}
130137
let result: vscode.Task[] = [];
131138
if (stdout) {
@@ -159,7 +166,7 @@ class FolderDetector {
159166
channel.appendLine(err.stdout);
160167
}
161168
channel.appendLine(localize('execFailed', 'Auto detecting gulp for folder {0} failed with error: {1}', this.workspaceFolder.name, err.error ? err.error.toString() : 'unknown'));
162-
channel.show(true);
169+
showError();
163170
return emptyTasks;
164171
}
165172
}

0 commit comments

Comments
 (0)