mirror of
https://github.com/wahyd4/gvm.git
synced 2026-08-09 12:56:41 +10:00
30 lines
572 B
Bash
Executable File
30 lines
572 B
Bash
Executable File
#!/bin/bash
|
|
if [[ $1 == "commit" ]]; then
|
|
mv $GVM_ROOT/git.bak $GVM_ROOT/.git
|
|
if [ $? -ne 0 ]; then
|
|
echo "Couldn't find git info"
|
|
exit 1
|
|
fi
|
|
if [[ -n $2 ]]; then
|
|
cd $GVM_ROOT && git add . && git commit -m "$2"
|
|
if [ $? -ne 0 ]; then
|
|
echo "Failed to commit"
|
|
exit 1
|
|
fi
|
|
fi
|
|
cd $GVM_ROOT && git push
|
|
if [ $? -ne 0 ]; then
|
|
echo "Failed to push"
|
|
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
|
|
|