Last active
August 25, 2023 12:25
-
-
Save nbolton/9ae834a58bc44e12648324ce08bb2f31 to your computer and use it in GitHub Desktop.
Scripts for fnm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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