fnm
fnm copied to clipboard
Can `--install-if-missing` be added to `fnm env` so that `--use-on-cd` can work without prompting
Currently with fnm env --use-on-cd
- If I
cdinto a directory that has a file defining a node version I do have, this works as expected by switching to the node version defined. - If I
cdinto a directory that has a file defining a node version I do not have have, I am prompted to install that version.- Correction: After the install is complete it is not automatically used.
I would like:
- If I
cdinto a directory that has a file defining a node version I do not have have, I would likefnmto automatically install and use that version without prompting me.
I imagine this behavior is not wanted by everyone, so I'm hoping this can be a separate flag so that people can opt to use it.
My solution for now, if that can help:
eval "$(fnm env --use-on-cd --shell zsh | sed 's/-unchanged/& --install-if-missing/')"