mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 09:35:36 -05:00
Import project from database (#10326)
* Initial changes for Import database as new project * Functionally complete code * Initial changes for Import database as new project * Functionally complete code * Resolved conflicts with latest changes. Also did some code refactoring. * Addressed comments. Added unit tests. * Addressed comments * Moved ExtractTarget enum from azdata to mssql * Addressed comments * Fixed indentation in project templates
This commit is contained in:
@@ -51,6 +51,25 @@ export function trimChars(input: string, chars: string): string {
|
||||
return output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the folder or file exists @param path path of the folder/file
|
||||
*/
|
||||
export async function exists(path: string): Promise<boolean> {
|
||||
try {
|
||||
await fs.access(path);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert camelCase input to PascalCase
|
||||
*/
|
||||
export function toPascalCase(input: string): string {
|
||||
return input.charAt(0).toUpperCase() + input.substr(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* get quoted path to be used in any commandline argument
|
||||
* @param filePath
|
||||
@@ -76,15 +95,3 @@ export function getSafeNonWindowsPath(filePath: string): string {
|
||||
filePath = filePath.split('\\').join('/').split('"').join('');
|
||||
return '"' + filePath + '"';
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the folder or file exists @param path path of the folder/file
|
||||
*/
|
||||
export async function exists(path: string): Promise<boolean> {
|
||||
try {
|
||||
await fs.access(path);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user