Skip to content

Commit

Permalink
Merge pull request #82 from axieinfinity/feature/test
Browse files Browse the repository at this point in the history
feat(ArtifactFactory): Auto create deployment factory if not exists
  • Loading branch information
TuDo1403 authored Feb 2, 2024
2 parents 0c15281 + 40064f6 commit 3aa1ca2
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 3aa1ca2

Please sign in to comment.