From 8a711cb7366a5c8c711b298440d8f44704569066 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Fri, 22 Apr 2022 11:45:45 +0100 Subject: [PATCH] Skip pro install on community forks --- scripts/pro/install.sh | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/scripts/pro/install.sh b/scripts/pro/install.sh index ffa123a821..074d1773cf 100755 --- a/scripts/pro/install.sh +++ b/scripts/pro/install.sh @@ -1,6 +1,6 @@ #!/bin/bash -if [[ -z "${CI}" ]]; then +if [[ -z "${CI}" ]] then echo 'Cannot run insall.sh unless in CI' exit 0 fi @@ -11,14 +11,21 @@ BASE_BRANCH=$2 cd ../ echo "Cloning pro repo..." git clone https://$PERSONAL_ACCESS_TOKEN@github.com/Budibase/budibase-pro.git -cd budibase-pro -# Try to checkout the matching pro branch -git checkout $BRANCH -# Try to checkout the matching pro base (master or develop) branch -git checkout $BASE_BRANCH -# If neither branch exists continue with default branch 'develop' -git pull +# Community forks won't be able to clone the pro repo as they can't access secrets +# Skip the rest of the installation and rely on npm version instead +# This should be ok as forks will not rely on pro changes +if [ -d "budibase-pro" ] +then + cd budibase-pro -echo "Initializing pro repo..." -yarn setup + # Try to checkout the matching pro branch + git checkout $BRANCH + # Try to checkout the matching pro base (master or develop) branch + git checkout $BASE_BRANCH + # If neither branch exists continue with default branch 'develop' + git pull + + echo "Initializing pro repo..." + yarn setup +fi \ No newline at end of file