Skip to content

Instantly share code, notes, and snippets.

@nbolton
Last active August 25, 2023 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nbolton/9ae834a58bc44e12648324ce08bb2f31 to your computer and use it in GitHub Desktop.
Save nbolton/9ae834a58bc44e12648324ce08bb2f31 to your computer and use it in GitHub Desktop.
Scripts for fnm
# unix/bash (.sh)
export PATH="/path/to/fnm:$PATH"
eval "`fnm env`"
if [ -f ".nvmrc" ]
then
fnm use
else
if [ -f "../.nvmrc" ]
then
fnm use ..
fi
fi
# windows (powershell)
fnm env --use-on-cd | Out-String | Invoke-Expression
if (Test-Path(".nvmrc")) {
fnm use
}
elseif (Test-Path("../.nvmrc")) {
fnm use ..
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment