Fix can't find SQLCMD variable error (#12672)

* remove sqlcmd variable deletion verification

* check if sqlcmd variable exists first
This commit is contained in:
Kim Santiago
2020-10-01 15:26:27 -07:00
committed by GitHub
parent 9b7a1d7a26
commit 253f7774de

View File

@@ -679,7 +679,9 @@ export class Project {
public addSqlCmdVariableToProjFile(entry: SqlCmdVariableProjectEntry): void {
// Remove any entries with the same variable name. It'll be replaced with a new one
this.removeFromProjFile(entry);
if (Object.keys(this.sqlCmdVariables).includes(entry.variableName)) {
this.removeFromProjFile(entry);
}
const sqlCmdVariableNode = this.projFileXmlDoc.createElement(constants.SqlCmdVariable);
sqlCmdVariableNode.setAttribute(constants.Include, entry.variableName);