From 2a6618f3758c41288fad2d5fc7973824b61b1d08 Mon Sep 17 00:00:00 2001 From: smithbk Date: Fri, 15 Sep 2023 12:09:21 -0400 Subject: [PATCH] Update update-sdk.sh to allow you to specify a branch name --- code/update-sdk.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/code/update-sdk.sh b/code/update-sdk.sh index 4850e906..fe2cd7a3 100755 --- a/code/update-sdk.sh +++ b/code/update-sdk.sh @@ -1,12 +1,16 @@ # Script that pulls the latest version of the SDK into your ThemeBuilder # To be used if there are any issues arise with pulling the latest SDK in your ThemeBuilder build -CUR_DIR=`pwd` +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +BRANCH=main +if [ $# -gt 0 ]; then + BRANCH=$1 +fi SDK=a11y-theme-builder-sdk -cd ../../$SDK -git checkout main +cd $SCRIPT_DIR/../../$SDK +git checkout $BRANCH git pull --rebase --autostash npm run build-lib -cd $CUR_DIR +cd $SCRIPT_DIR rm -rf src/ui/node_modules/.cache rm -rf src/ui/node_modules/$SDK cp -R ../../$SDK src/ui/node_modules