From 1a0b00fcadcd58625b319a9d009ae5753f48e844 Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Sun, 20 Oct 2019 20:15:20 +1300 Subject: [PATCH] Git clone as upgrade when running in docker (WIP) --- mopidy_iris/system.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mopidy_iris/system.sh b/mopidy_iris/system.sh index fe265264..d9f554b8 100755 --- a/mopidy_iris/system.sh +++ b/mopidy_iris/system.sh @@ -1,8 +1,15 @@ #!/bin/bash -if [[ $1 = "upgrade" ]]; then +CURR_DIR="$(pwd)" - UPGRADE="$(pip install --upgrade mopidy-iris)" +if [[ $1 = "upgrade" ]]; then + if [[ $CURR_DIR = "/iris/mopidy_iris/system.sh" ]]; then + echo "cd /iris && git checkout master && git pull origin master" + UPGRADE="$(cd /iris && git checkout master && git pull origin master)" + else + echo "pip install --upgrade mopidy-iris" + UPGRADE="$(pip install --upgrade mopidy-iris)" + fi echo -e "${UPGRADE}" elif [[ $1 = "restart" ]]; then