mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
Fix for #50792 npm exclude doesn´t work for folder names
This commit is contained in:
parent
9ab6f34772
commit
6a62a945ea
|
@ -58,7 +58,7 @@ function getPrePostScripts(scripts: any): Set<string> {
|
|||
const script = keys[i];
|
||||
const prepost = ['pre' + script, 'post' + script];
|
||||
prepost.forEach(each => {
|
||||
if (scripts[each] !== undefined) {
|
||||
if (scripts[each]) {
|
||||
prePostScripts.add(each);
|
||||
}
|
||||
});
|
||||
|
@ -142,15 +142,16 @@ function isExcluded(folder: WorkspaceFolder, packageJsonUri: Uri) {
|
|||
}
|
||||
|
||||
let exclude = workspace.getConfiguration('npm', folder.uri).get<string | string[]>('exclude');
|
||||
let packageJsonFolder = path.dirname(packageJsonUri.fsPath);
|
||||
|
||||
if (exclude) {
|
||||
if (Array.isArray(exclude)) {
|
||||
for (let pattern of exclude) {
|
||||
if (testForExclusionPattern(packageJsonUri.fsPath, pattern)) {
|
||||
if (testForExclusionPattern(packageJsonFolder, pattern)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if (testForExclusionPattern(packageJsonUri.fsPath, exclude)) {
|
||||
} else if (testForExclusionPattern(packageJsonFolder, exclude)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue