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

fix #149924
This commit is contained in:
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

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;
}