Don't open schema compare if project build fails (#13027)

* don't open schema compare if project build fails

* update error message
This commit is contained in:
Kim Santiago
2020-10-22 10:24:11 -07:00
committed by GitHub
parent 98774527bc
commit dfb1d5411e
2 changed files with 3 additions and 7 deletions

View File

@@ -272,17 +272,13 @@ export class ProjectsController {
// check if schema compare extension is installed
if (vscode.extensions.getExtension(constants.schemaCompareExtensionId)) {
// build project
await this.buildProject(treeNode);
// start schema compare with the dacpac produced from build
const project = this.getProjectFromContext(treeNode);
const dacpacPath = path.join(project.projectFolderPath, 'bin', 'Debug', `${project.projectFileName}.dacpac`);
const dacpacPath = await this.buildProject(treeNode);
// check that dacpac exists
if (await utils.exists(dacpacPath)) {
await vscode.commands.executeCommand(constants.schemaCompareStartCommand, dacpacPath);
} else {
vscode.window.showErrorMessage(constants.buildDacpacNotFound);
vscode.window.showErrorMessage(constants.buildFailedCannotStartSchemaCompare);
}
} else {
vscode.window.showErrorMessage(constants.schemaCompareNotInstalled);