You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
465 B
Plaintext

#!/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"