Fixing folder path in dacpac and schema compare extensions (#7352)

* fixing folder path in dacpac and schema compare extensions

* created method

* import os
This commit is contained in:
Kim Santiago
2019-09-25 15:00:56 -07:00
committed by GitHub
parent f7c468d6f0
commit e3c347e148
4 changed files with 14 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ import * as os from 'os';
import { SchemaCompareMainWindow } from '../schemaCompareMainWindow';
import { promises as fs } from 'fs';
import { Telemetry } from '../telemetry';
import { getEndpointName } from '../utils';
import { getEndpointName, getRootPath } from '../utils';
import * as mssql from '../../../mssql';
const localize = nls.loadMessageBundle();
@@ -314,7 +314,7 @@ export class SchemaCompareDialog {
currentButton.onDidClick(async (click) => {
// file browser should open where the current dacpac is or the appropriate default folder
let rootPath = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders[0].name : os.homedir();
let rootPath = getRootPath();
let defaultUri = endpoint && endpoint.packageFilePath && await exists(endpoint.packageFilePath) ? endpoint.packageFilePath : rootPath;
let fileUris = await vscode.window.showOpenDialog(