mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -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();
|
}).component();
|
||||||
|
|
||||||
this.generateScriptButton.onDidClick(async (click) => {
|
this.generateScriptButton.onDidClick(async (click) => {
|
||||||
// get file path
|
// generate default filename
|
||||||
let now = new Date();
|
let now = new Date();
|
||||||
let datetime = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate() + '-' + now.getHours() + '-' + now.getMinutes() + '-' + now.getSeconds();
|
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 defaultFileName = `${this.targetName}_Update_${datetime}.sql`;
|
||||||
let defaultFilePath = path.join(rootPath, this.targetName + '_Update_' + datetime + '.sql');
|
|
||||||
let fileUri = await vscode.window.showSaveDialog(
|
let fileUri = await vscode.window.showSaveDialog(
|
||||||
{
|
{
|
||||||
defaultUri: vscode.Uri.file(defaultFilePath),
|
defaultUri: vscode.Uri.file(defaultFileName),
|
||||||
saveLabel: localize('schemaCompare.saveFile', 'Save'),
|
saveLabel: localize('schemaCompare.saveFile', 'Save'),
|
||||||
filters: {
|
filters: {
|
||||||
'SQL Files': ['sql'],
|
'SQL Files': ['sql'],
|
||||||
|
|||||||
Reference in New Issue
Block a user