Browse Source

Merge pull request #254 from stelcheck/gitless

Gitless in Seattle
master
Tim Caswell 12 years ago
parent
commit
8983644854
  1. 30
      install-gitless.sh

30
install-gitless.sh

@ -1,24 +1,26 @@
#!/bin/bash #!/bin/bash
function fatalExit (){
echo "$@" && exit 1;
}
# an alternative URL that could be used: https://github.com/creationix/nvm/tarball/master # an alternative URL that could be used: https://github.com/creationix/nvm/tarball/master
TARBALL_URL="https://api.github.com/repos/creationix/nvm/tarball" if [ "$NVM_SOURCE" == "" ]; then
NVM_TARGET="$HOME/.nvm" NVM_SOURCE="https://raw.github.com/creationix/nvm/master/nvm.sh"
fi
if [ -d "$NVM_TARGET" ]; then if [ "$NVM_DIR" == "" ]; then
echo "=> NVM is already installed in $NVM_TARGET, trying to update" NVM_DIR="$HOME/.nvm"
rm -rf "$NVM_TARGET"
fi fi
# Downloading to $NVM_TARGET # Downloading to $NVM_DIR
mkdir "$NVM_TARGET" mkdir -p "$NVM_DIR"
pushd "$NVM_TARGET" > /dev/null pushd "$NVM_DIR" > /dev/null
echo -ne "=> " echo -ne "=> Downloading... "
curl --silent -L "$TARBALL_URL" | tar -xz --strip-components=1 || exit 1 curl --silent "$NVM_SOURCE" -o nvm.sh || fatalExit "Failed";
echo -n Downloaded echo "Downloaded"
popd > /dev/null popd > /dev/null
echo
# Detect profile file, .bash_profile has precedence over .profile # Detect profile file, .bash_profile has precedence over .profile
if [ ! -z "$1" ]; then if [ ! -z "$1" ]; then
PROFILE="$1" PROFILE="$1"
@ -30,7 +32,7 @@ else
fi fi
fi fi
SOURCE_STR="[[ -s "$NVM_TARGET/nvm.sh" ]] && . "$NVM_TARGET/nvm.sh" # This loads NVM" SOURCE_STR="[[ -s "$NVM_DIR/nvm.sh" ]] && . "$NVM_DIR/nvm.sh" # This loads NVM"
if [ -z "$PROFILE" ] || [ ! -f "$PROFILE" ] ; then if [ -z "$PROFILE" ] || [ ! -f "$PROFILE" ] ; then
if [ -z $PROFILE ]; then if [ -z $PROFILE ]; then

Loading…
Cancel
Save