From 59c0ef1a521ecb24963602a6beac6148b221ab58 Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Tue, 9 Feb 2021 12:24:58 -0800 Subject: [PATCH] install-gui.sh takes an arg to build the GUI from a different branch --- install-gui.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/install-gui.sh b/install-gui.sh index 45c67dcbcf45..dda59694323a 100644 --- a/install-gui.sh +++ b/install-gui.sh @@ -4,6 +4,9 @@ set -e echo "This requires the chia python virtual environment." echo "Execute '. ./activate' if you have not already, before running." +# Allows overriding the branch or commit to build in chia-blockchain-gui +SUBMODULE_BRANCH=$1 + UBUNTU=false # Manage npm and other install requirements on an OS specific basis if [ "$(uname)" = "Linux" ]; then @@ -55,18 +58,19 @@ fi # for Mac and Windows so skip unless completing a source/developer install # Ubuntu special cases above if [ ! "$CI" ]; then - SUBMODULE_STATUS=$(git submodule status) - if [[ $SUBMODULE_STATUS = " "* ]]; + git submodule update --init --recursive + echo "Running git submodule update --init --recursive." + echo "" + cd chia-blockchain-gui + git pull + echo "" + if [ "$SUBMODULE_BRANCH" ]; then - git submodule update --init --recursive - echo "Running git submodule update --init --recursive." + git checkout "$SUBMODULE_BRANCH" echo "" - else - echo "The chia-blockchain-gui submodule is in altered state." - echo "Skipping git submodule update." + echo "Building the GUI with branch $SUBMODULE_BRANCH" echo "" fi - cd chia-blockchain-gui npm install npm audit fix npm run locale:extract