mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Change schema compare generated script filepath (#5496)
* generated script filepath defaults to folder last opened in file dialog * use string interpolation
This commit is contained in:
@@ -334,14 +334,14 @@ export class SchemaCompareResult {
|
||||
}).component();
|
||||
|
||||
this.generateScriptButton.onDidClick(async (click) => {
|
||||
// get file path
|
||||
// generate default filename
|
||||
let now = new Date();
|
||||
let datetime = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate() + '-' + now.getHours() + '-' + now.getMinutes() + '-' + now.getSeconds();
|
||||
let rootPath = vscode.workspace.rootPath ? vscode.workspace.rootPath : os.homedir();
|
||||
let defaultFilePath = path.join(rootPath, this.targetName + '_Update_' + datetime + '.sql');
|
||||
let defaultFileName = `${this.targetName}_Update_${datetime}.sql`;
|
||||
|
||||
let fileUri = await vscode.window.showSaveDialog(
|
||||
{
|
||||
defaultUri: vscode.Uri.file(defaultFilePath),
|
||||
defaultUri: vscode.Uri.file(defaultFileName),
|
||||
saveLabel: localize('schemaCompare.saveFile', 'Save'),
|
||||
filters: {
|
||||
'SQL Files': ['sql'],
|
||||
|
||||
Reference in New Issue
Block a user