ensure that the scheme is 'file' detecting scripts

This commit is contained in:
Erich Gamma 2017-09-21 13:56:42 +02:00
parent c6686be263
commit 8844915863

View file

@ -104,9 +104,13 @@ function isEnabled(folder: vscode.WorkspaceFolder): boolean {
}
async function provideNpmScriptsForFolder(folder: vscode.WorkspaceFolder): Promise<vscode.Task[]> {
let rootPath = folder.uri.fsPath;
let emptyTasks: vscode.Task[] = [];
if (folder.uri.scheme !== 'file') {
return emptyTasks;
}
let rootPath = folder.uri.fsPath;
let packageJson = path.join(rootPath, 'package.json');
if (!await exists(packageJson)) {
return emptyTasks;