mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-11 14:51:49 +00:00
replaced undocumented option for specifying the profile as first argument to specifying it as a environment variable (eg: PROFILE=~/.myprofile ./install-gitless.sh)
also; fixed indentation and added .zshrc as possible profile
This commit is contained in:
parent
cb3d8bf99c
commit
365167a4a3
@ -20,14 +20,14 @@ echo "Downloaded"
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Detect profile file, .bash_profile has precedence over .profile
|
# Detect profile file if not specified as environment variable (eg: PROFILE=~/.myprofile).
|
||||||
if [ ! -z "$1" ]; then
|
if [ ! "$PROFILE" ]; then
|
||||||
PROFILE="$1"
|
|
||||||
else
|
|
||||||
if [ -f "$HOME/.bash_profile" ]; then
|
if [ -f "$HOME/.bash_profile" ]; then
|
||||||
PROFILE="$HOME/.bash_profile"
|
PROFILE="$HOME/.bash_profile"
|
||||||
|
elif [ -f "$HOME/.zshrc" ]; then
|
||||||
|
PROFILE="$HOME/.zshrc"
|
||||||
elif [ -f "$HOME/.profile" ]; then
|
elif [ -f "$HOME/.profile" ]; then
|
||||||
PROFILE="$HOME/.profile"
|
PROFILE="$HOME/.profile"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
12
install.sh
12
install.sh
@ -28,16 +28,14 @@ fi
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
# Detect profile file, .bash_profile has precedence over .profile
|
# Detect profile file if not specified as environment variable (eg: PROFILE=~/.myprofile).
|
||||||
if [ ! -z "$1" ]; then
|
if [ ! "$PROFILE" ]; then
|
||||||
PROFILE="$1"
|
|
||||||
else
|
|
||||||
if [ -f "$HOME/.bash_profile" ]; then
|
if [ -f "$HOME/.bash_profile" ]; then
|
||||||
PROFILE="$HOME/.bash_profile"
|
PROFILE="$HOME/.bash_profile"
|
||||||
elif [ -f "$HOME/.zshrc" ]; then
|
elif [ -f "$HOME/.zshrc" ]; then
|
||||||
PROFILE="$HOME/.zshrc"
|
PROFILE="$HOME/.zshrc"
|
||||||
elif [ -f "$HOME/.profile" ]; then
|
elif [ -f "$HOME/.profile" ]; then
|
||||||
PROFILE="$HOME/.profile"
|
PROFILE="$HOME/.profile"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user