Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions packages/devtools-evm-hardhat/src/tasks/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,24 @@ const action: ActionType<TaskArgs> = async (
error == null ? [] : [{ networkName, error }]
)

// We count the total number of contracts that were deployed across all networks
const totalDeployedContracts = Object.values(results).reduce(
(acc, { contracts }) => acc + (contracts ? Object.keys(contracts).length : 0),
0
)

// If tags were specified but no contracts were deployed, warn the user
if (selectedTags.length > 0 && totalDeployedContracts === 0 && errors.length === 0) {
logger.warn(
`${printBoolean(false)} No deploy scripts matched the given ${pluralizeNoun(selectedTags.length, 'tag', 'tags')}: ${selectedTags.join(', ')}`
)
Comment thread
farivar-tabatabaei marked this conversation as resolved.

// Mark the process as unsuccessful
process.exitCode = process.exitCode || 1

return results
}
Comment thread
cursor[bot] marked this conversation as resolved.

// If nothing went wrong we just exit
if (errors.length === 0) {
return logger.info(`${printBoolean(true)} Your contracts are now deployed`), results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ expect "Do you want to continue?"
send -- "\r"

expect "Deploying..."
expect "Your contracts are now deployed"
expect "No deploy scripts matched the given tag: MeNoExist"

expect eof