use previous file location if there was one (#6625)

This commit is contained in:
Kim Santiago
2019-08-06 17:41:43 -07:00
committed by GitHub
parent 8e36821c6b
commit fd73fba1a7

View File

@@ -164,9 +164,13 @@ export abstract class DacFxConfigPage extends BasePage {
} }
protected getRootPath(): string { protected getRootPath(): string {
// return rootpath of opened folder in file explorer if one is open, otherwise default to user home directory // 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(); return vscode.workspace.rootPath ? vscode.workspace.rootPath : os.homedir();
} }
}
protected appendFileExtensionIfNeeded() { protected appendFileExtensionIfNeeded() {
// make sure filepath ends in proper file extension if it's a valid name // make sure filepath ends in proper file extension if it's a valid name