shell-host/lang/fnm/fnm

26 lines
709 B
Bash

#!/bin/bash
if command -v fnm >/dev/null 2>&1; then
_fnmenv="$(fnm env --fnm-dir $FNM_DIR --use-on-cd)"
# echo "$_fnmenv"
# echo "---------"
eval "$_fnmenv"
if ! fnm use lts-latest >/dev/null 2>&1; then
echo the latest long term support version is not installed so installing
fnm install --lts
fvm use lts-lastest
echo current active version $(node --version)
fi
alias fnml="fnm use lts-latest"
# alias nvmil="nvm install --lts --latest-npm"
alias fnmu="fnm use"
alias fnmls="fnm ls"
alias fnmc="fnm current"
# echo added fnm to shell, $NVM_DIR
else
echo FATAL! fnm is not installed or in the path cannot add node via fnm to shell
fi