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

@@ -167,9 +167,7 @@ export class DeployActionPage extends DacFxConfigPage {
}
private setDefaultScriptFilePath(): void {
let now = new Date();
let datetime = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate() + '-' + now.getHours() + '-' + now.getMinutes();
this.fileTextBox.value = path.join(os.homedir(), this.model.database + '_UpgradeDACScript_' + datetime + '.sql');
this.fileTextBox.value = path.join(this.getRootPath(), this.model.database + '_UpgradeDACScript_' + this.getDateTime() + '.sql');
this.model.scriptFilePath = this.fileTextBox.value;
}

View File

@@ -72,7 +72,7 @@ export class DeployConfigPage extends DacFxConfigPage {
canSelectFiles: true,
canSelectFolders: false,
canSelectMany: false,
defaultUri: vscode.Uri.file(os.homedir()),
defaultUri: vscode.Uri.file(this.getRootPath()),
openLabel: localize('dacFxDeploy.openFile', 'Open'),
filters: {
'dacpac Files': ['dacpac'],

View File

@@ -65,7 +65,7 @@ export class ExportConfigPage extends DacFxConfigPage {
this.createFileBrowserParts();
// default filepath
this.fileTextBox.value = this.generateFilePath();
this.fileTextBox.value = this.generateFilePathFromDatabaseAndTimestamp();
this.model.filePath = this.fileTextBox.value;
this.fileButton.onDidClick(async (click) => {

View File

@@ -68,7 +68,7 @@ export class ExtractConfigPage extends DacFxConfigPage {
this.createFileBrowserParts();
// default filepath
this.fileTextBox.value = this.generateFilePath();
this.fileTextBox.value = this.generateFilePathFromDatabaseAndTimestamp();
this.model.filePath = this.fileTextBox.value;
this.fileButton.onDidClick(async (click) => {

View File

@@ -62,7 +62,7 @@ export class ImportConfigPage extends DacFxConfigPage {
canSelectFiles: true,
canSelectFolders: false,
canSelectMany: false,
defaultUri: vscode.Uri.file(os.homedir()),
defaultUri: vscode.Uri.file(this.getRootPath()),
openLabel: localize('dacFxImport.openFile', 'Open'),
filters: {
'bacpac Files': ['bacpac'],