From 77845e4732f8a807d68ec88a81f52b88e3336444 Mon Sep 17 00:00:00 2001 From: Lars Berning <151194+laberning@users.noreply.github.com> Date: Mon, 17 Jan 2022 21:29:50 +0100 Subject: [PATCH] fixes a bug, where update-script could not be called from any directory --- bin/updateopenrowingmonitor.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/updateopenrowingmonitor.sh b/bin/updateopenrowingmonitor.sh index 7db36d1..a30278e 100755 --- a/bin/updateopenrowingmonitor.sh +++ b/bin/updateopenrowingmonitor.sh @@ -98,14 +98,15 @@ CURRENT_DIR=$(pwd) SCRIPT_DIR="$( cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd )" INSTALL_DIR="$(dirname "$SCRIPT_DIR")" GIT_REMOTE="https://github.com/laberning/openrowingmonitor.git" + +cd $INSTALL_DIR + CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) LOCAL_VERSION=$(git rev-parse HEAD) print "Update script for Open Rowing Monitor" print -cd $INSTALL_DIR - if getopts "b:" arg; then if [ $CURRENT_BRANCH = $OPTARG ]; then cancel "No need to switch to branch \"$OPTARG\", it is already the active branch"