Skip to content

Conversation

maximevtush
Copy link

Summary

Ensure the CLI uses the bundled dist binary when the platform package resolves but its binary file is missing, improving reliability on partially installed or corrupted environments.

Changes

  • Refactor getBinaryPath() to:
    • Prefer resolved platform-specific binary only if the file exists.
    • Fallback to dist/forge (or forge.exe on Windows) when the resolved path is missing.
    • Exit with a clear error only if neither binary is available.

Why

require.resolve(...) can succeed while the actual file is missing (e.g., cache/corruption). Previously, the launcher didn’t use the fallback in this case, causing unnecessary failures.

@DaniPopes
Copy link
Member

We do not accept useless slop prs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants