Skip to content

Commit

Permalink
fix: silent exit if broadcast directory doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi committed Jul 17, 2024
1 parent d6ee532 commit 9e5e96d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/solidity-devops/js/utils/deployments.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ const getNewDeploymentReceipts = (chainName, scriptFN, timestamp) => {
const chainId = getChainId(chainName)
const scriptBaseName = path.basename(scriptFN)
const broadcastDir = path.join('broadcast', scriptBaseName, chainId)
// Silent exit if the broadcast directory does not exist
if (!fs.existsSync(broadcastDir)) {
logError(
`No broadcast directory found for ${scriptBaseName} at ${broadcastDir}`
)
return []
}
// Look for "*-latest.json" files created after the given timestamp.
// These are named after the script entry function, which is usually "run", but could be different.
// In practice there should be only one file, but we implement a generic logic just in case.
Expand Down

0 comments on commit 9e5e96d

Please sign in to comment.