Change default folder in dacpac and schema compare extensions (#5215)

* change default folder in dacpac and schema compare extensions

* move getting rootpath to a method

* change method name
This commit is contained in:
kisantia
2019-04-27 04:27:03 +12:00
committed by GitHub
parent 23f4931a1d
commit 64377000c6
8 changed files with 23 additions and 14 deletions

View File

@@ -291,7 +291,8 @@ export class SchemaCompareResult {
// get file path
let now = new Date();
let datetime = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate() + '-' + now.getHours() + '-' + now.getMinutes() + '-' + now.getSeconds();
let defaultFilePath = path.join(os.homedir(), this.targetName + '_Update_' + datetime + '.sql');
let rootPath = vscode.workspace.rootPath ? vscode.workspace.rootPath : os.homedir();
let defaultFilePath = path.join(rootPath, this.targetName + '_Update_' + datetime + '.sql');
let fileUri = await vscode.window.showSaveDialog(
{
defaultUri: vscode.Uri.file(defaultFilePath),