mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-20 17:22:51 -05:00
Add SQL Bindings Tests / Vbump (#19717)
* add further testing * vbump version * add successfully test * address comments
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user