Files
gvm/scripts/get
T
Ali Abbas c1ec392bdd - Double quoting to avoid globbing
- Remove unecessary $(cat)
- switch * to ./* to avoid entries with dashes to be treated as options
- replace $* with "$@"
- repeating change path serial calls - unecessary if change path is called one (get script)
2014-04-12 15:56:54 +02:00

18 lines
465 B
Bash
Executable File

#!/usr/bin/env bash
. "$GVM_ROOT/scripts/functions"
[[ -d $GVM_ROOT/.git ]] || mv "$GVM_ROOT/git.bak" "$GVM_ROOT/.git" &> /dev/null ||
display_fatal "Couldn't find git info"
cd "$GVM_ROOT"
if [[ -n $1 ]]; then
git checkout "$1" -f || display_fatal "Failed to checkout $1 branch"
else
git checkout -f || display_fatal "Failed to clean install"
fi
git pull || display_fatal "Failed to update"
mv ".git" "git.bak" || display_fatal "Couldn't backup git info"