Allow edit of sqlproj in place and reload (#11980)

* edit sql proj file

* bug fix

* updating reload project method

* adding test for reload

* formatting
This commit is contained in:
anjalia
2020-09-03 10:08:12 -07:00
committed by GitHub
parent 887ce88100
commit d97993e518
9 changed files with 162 additions and 0 deletions

View File

@@ -56,6 +56,8 @@ export class Project {
* Reads the project setting and contents from the file
*/
public async readProjFile() {
this.resetProject();
const projFileText = await fs.readFile(this.projectFilePath);
this.projFileXmlDoc = new xmldom.DOMParser().parseFromString(projFileText.toString());
@@ -147,6 +149,17 @@ export class Project {
}
}
private resetProject() {
this.files = [];
this.importedTargets = [];
this.databaseReferences = [];
this.sqlCmdVariables = {};
this.preDeployScripts = [];
this.postDeployScripts = [];
this.noneDeployScripts = [];
this.projFileXmlDoc = undefined;
}
public async updateProjectForRoundTrip() {
await fs.copyFile(this.projectFilePath, this.projectFilePath + '_backup');
await this.updateImportToSupportRoundTrip();