I would like convert a Bash script to a Fish script to test if file .nvmrc
exists.
Bash script:
## Auto load nvm when there's a .nvmrc file
OLD_PWD=""
promptCommand() {
if [ "$OLD_PWD" != "$PWD" ] ;
then
OLD_PWD="$PWD"
if [ -e .nvmrc ] ;
then nvm use;
fi
fi
}
export PROMPT_COMMAND=promptCommand
And Fish script (don't work):
set OLD_PWD ""
function nvm_prompt
if [ "$OLD_PWD" != "$PWD" ]
then
OLD_PWD="$PWD"
if [ -e .nvmrc ]
then bass source ~/.nvm/nvm.sh --no-use ';' nvm use
end
end
end