mirror of
https://github.com/wahyd4/gvm.git
synced 2026-08-13 23:06:49 +10:00
35 lines
693 B
Bash
Executable File
35 lines
693 B
Bash
Executable File
#!/bin/bash
|
|
if [[ $1 == "get" ]]; then
|
|
mv $GVM_ROOT/git.bak $GVM_ROOT/.git
|
|
if [ $? -ne 0 ]; then
|
|
echo "Couldn't find git info"
|
|
exit 1
|
|
fi
|
|
cd $GVM_ROOT && git checkout -f
|
|
if [ $? -ne 0 ]; then
|
|
echo "Failed to clean install"
|
|
exit 1
|
|
fi
|
|
if [[ -n $2 ]]; then
|
|
cd $GVM_ROOT && git checkout $2 -f
|
|
if [ $? -ne 0 ]; then
|
|
echo "Failed to checkout $2 branch"
|
|
exit 1
|
|
fi
|
|
fi
|
|
cd $GVM_ROOT && git pull
|
|
if [ $? -ne 0 ]; then
|
|
echo "Failed to update"
|
|
exit 1
|
|
fi
|
|
mv $GVM_ROOT/.git $GVM_ROOT/git.bak
|
|
if [ $? -ne 0 ]; then
|
|
echo "Couldn't backup git info"
|
|
exit 1
|
|
fi
|
|
else
|
|
echo "Please use gvm [action] to call this file"
|
|
exit 1
|
|
fi
|
|
|