Add sql bindings package reference to project (#16912)

* list packages and add packages working

* cleanup and remove list packages

* cleanup

* change to pull in latest package version
This commit is contained in:
Kim Santiago
2021-08-27 16:58:54 -07:00
committed by GitHub
parent 22141259d3
commit 2c75f199e8
5 changed files with 134 additions and 2 deletions

View File

@@ -488,3 +488,20 @@ export async function retry<T>(
return undefined;
}
/**
* Gets all the projects of the specified extension in the folder
* @param folder
* @param projectExtension project extension to filter on
* @returns array of project uris
*/
export async function getAllProjectsInFolder(folder: vscode.Uri, projectExtension: string): Promise<vscode.Uri[]> {
// path needs to use forward slashes for glob to work
const escapedPath = glob.escapePath(folder.fsPath.replace(/\\/g, '/'));
// filter for projects with the specified project extension
const projFilter = path.posix.join(escapedPath, '**', `*${projectExtension}`);
// glob will return an array of file paths with forward slashes, so they need to be converted back if on windows
return (await glob(projFilter)).map(p => vscode.Uri.file(path.resolve(p)));
}