allow excluding npm `install` script from the npm scripts view (#151647)

fix #149924
pull/128662/merge
Megan Rogge 2022-06-09 16:15:43 -08:00 committed by GitHub
parent 160855dfb7
commit 4222eb73aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -287,8 +287,9 @@ async function provideNpmScriptsForFolder(context: ExtensionContext, packageJson
result.push({ task, location: new Location(packageJsonUri, nameRange) });
}
// always add npm install (without a problem matcher)
result.push({ task: await createTask(packageManager, INSTALL_SCRIPT, [INSTALL_SCRIPT], folder, packageJsonUri, 'install dependencies from package', []) });
if (!workspace.getConfiguration('npm', folder).get<string[]>('scriptExplorerExclude', []).find(e => e.includes('install'))) {
result.push({ task: await createTask(packageManager, INSTALL_SCRIPT, [INSTALL_SCRIPT], folder, packageJsonUri, 'install dependencies from package', []) });
}
return result;
}