fnm
fnm copied to clipboard
[Request] Add --install-if-missing to fnm exec ?
I'm calling fnm
directly and not using a shell environment. This means fnm use
fails because it can't find the environment it depends on. I would love being able to pass --install-if-missing
directly to fnm exec
, e.g.
$ fnm exec --using="v10.24.1" --install-if-missing -- node --version
Installing Node v10.24.1 (x64)
v10.24.1
$ fnm exec --using="v10.24.1" --install-if-missing -- node --version
v10.24.1
$ fnm exec --using="v10.24.1" --install-if-missing -- node --version
v10.24.1
I'd also love this for fnm env --use-on-cd
.
Alternatively, supporting a ~/.fnmrc
with default arguments would also go a long way with these workflow-specific requirements. (sorry if it's already a feature, I didn't see any mention of it in the docs)
It's surprising that this isn't default behaviour.
As it is, cd
-ing into a directory after .nvmrc
has changed just errors out with "Requested version vx.x.x is not currently installed" and break stuff, making use-on-cd
a lot less useful.