Fetching contributors…
Cannot retrieve contributors at this time
executable file 47 lines (38 sloc) 841 Bytes
#!/bin/bash
cd "$GBINSTALLDIR"
GBSMHASCHANGES=$(git status | grep "# Your branch is behind ")
cd - &>/dev/null
if [ -n "$GBSMHASCHANGES" ]; then
EXIT="NO"
while [ "$EXIT"=="NO" ]; do
echo "Looks like there are updates available for gb-sysmenu."
echo "What would you like to do? [Ignore]"
echo -e " [S]#See new commits\n [U]#Update sem medo!" | column -s'#' -t
read -p "Option: "
case $REPLY in
S|s)
echo
cd "$GBINSTALLDIR"
git log master..origin/master --pretty=format:"%an: %s"
cd - &>/dev/null
echo
EXIT="NO"
;;
U|u)
cd "$GBINSTALLDIR"
git pull
git submodule foreach git pull
EXIT="YES"
echo "gb-sysmenu updated!"
cd - &>/dev/null
exit 0;
;;
*)
echo "Ignoring updates."
EXIT="YES"
exit 0;
;;
esac
done
fi
(cd "$GBINSTALLDIR" && git fetch &>/dev/null &)