Merge pull request #9394 from ChristianAlexander/workspace-contains-directory
Allow workspaceContains to specify directories (fixes #8295).
This commit is contained in:
commit
02d72406d4
2 changed files with 8 additions and 1 deletions
|
@ -199,6 +199,13 @@ export function fileExistsWithResult<T>(path: string, successResult: T): TPromis
|
|||
});
|
||||
}
|
||||
|
||||
export function existsWithResult<T>(path: string, successResult: T): TPromise<T> {
|
||||
return exists(path).then((exists) => {
|
||||
return exists ? successResult : null;
|
||||
}, (err) => {
|
||||
return TPromise.wrapError(err);
|
||||
});
|
||||
}
|
||||
|
||||
function removeNull<T>(arr: T[]): T[] {
|
||||
return arr.filter(item => (item !== null));
|
||||
|
|
|
@ -246,7 +246,7 @@ export class ExtensionHostMain {
|
|||
|
||||
return TPromise.join(
|
||||
Object.keys(desiredFilesMap).map(
|
||||
(fileName) => pfs.fileExistsWithResult(paths.join(folderPath, fileName), fileName)
|
||||
(fileName) => pfs.existsWithResult(paths.join(folderPath, fileName), fileName)
|
||||
)
|
||||
).then((fileNames: string[]) => {
|
||||
fileNames.forEach((existingFileName) => {
|
||||
|
|
Loading…
Reference in a new issue