mirror of
https://github.com/wahyd4/gvm.git
synced 2026-08-09 04:46:19 +10:00
- 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)
18 lines
465 B
Bash
Executable File
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"
|