Skip to content
Merged
Changes from all commits
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
2 changes: 1 addition & 1 deletion wagmi-project/packages/cli/src/plugins/foundry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export function foundry(config: FoundryConfig = {}): FoundryResult {
return {
async contracts() {
if (clean)
execSync(`${forgeExecutable} clean --root ${project}`, {
spawnSync(forgeExecutable, ['clean', '--root', project], {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The switch from execSync to spawnSync changes the error handling behavior. execSync throws an exception if the command returns a non-zero exit code, whereas spawnSync returns a result object containing the status. This means that if forge clean fails, the error will now be silently ignored. You should check the status property of the result to ensure that failures are properly handled, similar to the check implemented on line 165. Additionally, consider applying this change consistently to the build command on line 187.

encoding: 'utf-8',
Comment thread
Dargon789 marked this conversation as resolved.
stdio: 'pipe',
})
Expand Down