don't attempt to link contract if it's not in the code

This commit is contained in:
Iuri Matias 2017-12-19 11:35:21 -05:00
parent 4008f15910
commit 8e323d6870
1 changed files with 3 additions and 0 deletions

View File

@ -109,6 +109,9 @@ class Deploy {
deployedAddress = deployedAddress.substr(2); deployedAddress = deployedAddress.substr(2);
} }
let linkReference = '__' + filename + ":" + contractObj.className; let linkReference = '__' + filename + ":" + contractObj.className;
if (contractCode.indexOf(linkReference) < 0) {
continue;
}
let toReplace = linkReference + "_".repeat(40 - linkReference.length); let toReplace = linkReference + "_".repeat(40 - linkReference.length);
contractCode = contractCode.replace(new RegExp(toReplace, "g"), deployedAddress); contractCode = contractCode.replace(new RegExp(toReplace, "g"), deployedAddress);
} }