From 96a93949d3a821adfd8ecd7ce82491b31d89b3ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Maih=C3=B6fer?= Date: Tue, 19 Mar 2024 13:35:50 +0100 Subject: [PATCH] shared in install scripts --- install_local.sh | 12 +++++++++++- update_repos.sh | 23 +++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/install_local.sh b/install_local.sh index a9deb98..b806092 100755 --- a/install_local.sh +++ b/install_local.sh @@ -41,9 +41,19 @@ fi set -e set -o pipefail +npm install +echo "INSTALLING SHARED..." +cd shared/ +if [ "$CLEAN" = "true" ]; then + echo " ...deleting node modules"; + rm -rf node_modules/ +fi +git checkout develop +git pull +npm install +cd .. echo "INSTALLING CORE..." -npm install if [ ! -d "cables/" ]; then git clone git@github.com:pandrr/cables.git fi diff --git a/update_repos.sh b/update_repos.sh index 89e1e61..edc89a1 100755 --- a/update_repos.sh +++ b/update_repos.sh @@ -21,6 +21,29 @@ fi set -e set -o pipefail +echo "UPDATING SHARED..." +cd shared +if [ -n "${1}" ] && [ "clean" != "${1}" ]; then + git checkout "${1}" +fi +# get current branch +branch=`git rev-parse --abbrev-ref HEAD` +# ignore errors here, since branch might not be on remote +git fetch || true +git pull origin "$branch" || true +# merge current remote develop if branch is not master +if [ "master" != "${branch}" ]; then + echo "merging current state of origin/develop into ${branch}"; + git merge origin/develop; +else + echo "WARNING: not merging origin/develop into master!" +fi +if [ "clean" == "${1}" ]; then + rm -rf node_modules/ +fi +npm i +cd .. + echo "UPDATING CORE..." cd cables if [ -n "${1}" ] && [ "clean" != "${1}" ]; then