Add SQL Bindings Tests / Vbump (#19717)

* add further testing

* vbump version

* add successfully test

* address comments
This commit is contained in:
Vasu Bhog
2022-06-14 14:47:36 -07:00
committed by GitHub
parent ba82444229
commit 6ab09d9b1b
8 changed files with 384 additions and 70 deletions

View File

@@ -116,7 +116,9 @@ export async function getUniqueFileName(fileName: string, folderPath?: string):
let uniqueFileName = fileName;
while (count < maxCount) {
if (!fs.existsSync(path.join(folderPath, uniqueFileName + '.cs'))) {
// checks to see if file exists
let uniqueFilePath = path.join(folderPath, uniqueFileName + '.cs');
if (!(await exists(uniqueFilePath))) {
return uniqueFileName;
}
count += 1;
@@ -173,3 +175,12 @@ export function getErrorType(error: any): string | undefined {
return 'UnknownError';
}
}
export async function exists(path: string): Promise<boolean> {
try {
await fs.promises.access(path);
return true;
} catch (e) {
return false;
}
}