Skip to content

feat(env): add --install-if-missing flag to --use-on-cd#1520

Open
pd4d10 wants to merge 2 commits intoSchniz:masterfrom
pd4d10:feat/env-install-if-missing
Open

feat(env): add --install-if-missing flag to --use-on-cd#1520
pd4d10 wants to merge 2 commits intoSchniz:masterfrom
pd4d10:feat/env-install-if-missing

Conversation

@pd4d10
Copy link
Copy Markdown

@pd4d10 pd4d10 commented Mar 7, 2026

Summary

Fixes #1452

  • Adds --install-if-missing flag to fnm env that passes --install-if-missing to the fnm use call in the generated --use-on-cd shell hook
  • When set, both the initial inline fnm use (at eval time) and the cd hook will automatically install the target Node version if it's not already present
  • The flag is gated with requires = "use_on_cd" so it can only be used together with --use-on-cd

Usage

eval "$(fnm env --use-on-cd --install-if-missing)"

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 7, 2026

⚠️ No Changeset found

Latest commit: ec21f55

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

Can --install-if-missing be added to fnm env so that --use-on-cd can work without prompting

1 participant