Skip to content

Commit

Permalink
script(ArtifactFactory): auto create deployment folder
Browse files Browse the repository at this point in the history
  • Loading branch information
TuDo1403 committed Jan 23, 2024
1 parent 511b10b commit 32a3b21
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions script/ArtifactFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ contract ArtifactFactory is IArtifactFactory {
return;
}
string memory dirPath = CONFIG.getDeploymentDirectory(CONFIG.getCurrentNetwork());
if (!vm.exists(dirPath)) {
console.log("\n", string.concat(dirPath, " not existed, making one...").yellow());
vm.createDir(dirPath, true);
vm.writeFile(string.concat(dirPath, ".chainId"), vm.toString(block.chainid));
}
string memory filePath = string.concat(dirPath, fileName, ".json");

string memory json;
Expand Down

0 comments on commit 32a3b21

Please sign in to comment.