From fd73fba1a7da739db050c536dd3bbba1baa2e5d8 Mon Sep 17 00:00:00 2001 From: Kim Santiago <31145923+kisantia@users.noreply.github.com> Date: Tue, 6 Aug 2019 17:41:43 -0700 Subject: [PATCH] use previous file location if there was one (#6625) --- extensions/dacpac/src/wizard/api/dacFxConfigPage.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts b/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts index 962e680a83..3f6e51869d 100644 --- a/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts +++ b/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts @@ -164,8 +164,12 @@ export abstract class DacFxConfigPage extends BasePage { } protected getRootPath(): string { - // return rootpath of opened folder in file explorer if one is open, otherwise default to user home directory - return vscode.workspace.rootPath ? vscode.workspace.rootPath : os.homedir(); + // use previous file location if there was one + if (this.fileTextBox.value && path.dirname(this.fileTextBox.value)) { + return path.dirname(this.fileTextBox.value); + } else { // otherwise use the folder open in the Explorer or the home directory + return vscode.workspace.rootPath ? vscode.workspace.rootPath : os.homedir(); + } } protected appendFileExtensionIfNeeded() {