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:
Sakshi Sharma
2020-05-26 16:08:24 -07:00
committed by GitHub
parent f0d86f8acb
commit 9a55b0275d
21 changed files with 604 additions and 50 deletions

View File

@@ -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;
}
}