mirror of https://github.com/embarklabs/embark.git
throw error when target lib is not found
This commit is contained in:
parent
7c33720c98
commit
cfaccb307b
|
@ -116,6 +116,10 @@ class Deploy {
|
||||||
}
|
}
|
||||||
let linkReference = '__' + filename + ":" + contractObj.className;
|
let linkReference = '__' + filename + ":" + contractObj.className;
|
||||||
let toReplace = linkReference + "_".repeat(40 - linkReference.length);
|
let toReplace = linkReference + "_".repeat(40 - linkReference.length);
|
||||||
|
if (contractCode.indexOf(linkReference) >= 0 && deployedAddress === undefined) {
|
||||||
|
let libraryName = contractObj.className;
|
||||||
|
return callback(new Error(contract.className + " needs " + libraryName + " but an address was not found, did you deploy it or configured an address?"));
|
||||||
|
}
|
||||||
contractCode = contractCode.replace(new RegExp(toReplace, "g"), deployedAddress);
|
contractCode = contractCode.replace(new RegExp(toReplace, "g"), deployedAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue