Benjin/project update bug (#18532)

* correct result.success

* shifting success message to actually check success

* keying on errorMessage rather than success
This commit is contained in:
Benjin Dubishar
2022-02-25 16:59:28 -08:00
committed by GitHub
parent 5e93f2ca9b
commit c64655ae71
2 changed files with 18 additions and 19 deletions

View File

@@ -534,21 +534,23 @@ export class ProjectsController {
const result: mssql.SchemaComparePublishProjectResult = await service.schemaComparePublishProjectChanges(operationId, projectPath, fs, utils.getAzdataApi()!.TaskExecutionMode.execute);
const project = await Project.openProject(projectFilePath);
if (result.errorMessage === '') {
const project = await Project.openProject(projectFilePath);
let toAdd: vscode.Uri[] = [];
result.addedFiles.forEach((f: any) => toAdd.push(vscode.Uri.file(f)));
await project.addToProject(toAdd);
let toAdd: vscode.Uri[] = [];
result.addedFiles.forEach((f: any) => toAdd.push(vscode.Uri.file(f)));
await project.addToProject(toAdd);
let toRemove: vscode.Uri[] = [];
result.deletedFiles.forEach((f: any) => toRemove.push(vscode.Uri.file(f)));
let toRemove: vscode.Uri[] = [];
result.deletedFiles.forEach((f: any) => toRemove.push(vscode.Uri.file(f)));
let toRemoveEntries: FileProjectEntry[] = [];
toRemove.forEach(f => toRemoveEntries.push(new FileProjectEntry(f, f.path.replace(projectPath + '\\', ''), EntryType.File)));
let toRemoveEntries: FileProjectEntry[] = [];
toRemove.forEach(f => toRemoveEntries.push(new FileProjectEntry(f, f.path.replace(projectPath + '\\', ''), EntryType.File)));
toRemoveEntries.forEach(async f => await project.exclude(f));
toRemoveEntries.forEach(async f => await project.exclude(f));
await this.buildProject(project);
await this.buildProject(project);
}
return result;
}