Skip to content

fix: create deployment directory before writing -latest.json#3

Merged
boyuanx merged 1 commit intomainfrom
fix/latest-json-always-write
Mar 3, 2026
Merged

fix: create deployment directory before writing -latest.json#3
boyuanx merged 1 commit intomainfrom
fix/latest-json-always-write

Conversation

@boyuanx
Copy link
Contributor

@boyuanx boyuanx commented Mar 3, 2026

Summary

Follow-up to #2. When all deployments are skipped (contracts already exist on-chain), the deployments/{category}/ directory may not exist because it is normally created inside __deploy()_saveContractToStandardJsonInput(). This causes vm.writeJson to fail with "No such file or directory" on retry runs.

  • Adds vm.createDir(..., true) before writing -latest.json, matching the existing pattern at line 796
  • vm.createDir with true is mkdir -p — no-op if directory already exists

Test plan

  • forge build compiles
  • Deploy to testnet, delete deployments/ folder entirely, re-run — verify -latest.json is created

When all deployments are skipped (contracts already on-chain), the
deployments/{category}/ directory may not exist yet because it is
normally created inside __deploy() via _saveContractToStandardJsonInput.
Ensure the directory exists before vm.writeJson to prevent "No such
file or directory" errors on retry runs.
@boyuanx boyuanx merged commit c26b372 into main Mar 3, 2026
1 check passed
@boyuanx boyuanx deleted the fix/latest-json-always-write branch March 3, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant