From 8ffa0b4cb4cd19d38d81189e31058f6efe36832a Mon Sep 17 00:00:00 2001 From: ashandme Date: Thu, 17 Apr 2025 22:54:13 -0300 Subject: [PATCH] added branch support --- deploy.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/deploy.sh b/deploy.sh index 9046604..7530848 100755 --- a/deploy.sh +++ b/deploy.sh @@ -40,6 +40,8 @@ ${bold}OPTIONS${normal} ${bold}-c | --config${normal} Replaces a variable in all configuration files containing it. The format is 'key=value'. + ${bold}-b | --branch${normal} Sets the branch name to build, by default its main. + ${bold}COMPATIBILITY${normal} The repository must be in ${bold}sisoputnfrba${normal} organization and have makefiles to compile each project or dependency. @@ -92,6 +94,7 @@ LIBRARIES=() DEPENDENCIES=() PROJECTS=() CONFIGURATIONS=() +BRANCH="main" OPTIONS=("${@:1:$#-1}") for i in "${OPTIONS[@]}" @@ -113,6 +116,10 @@ do CONFIGURATIONS+=("${i#*=}") shift ;; + -b=*|--branch=*) + BRANCH=("${i#*=}") + shift + ;; *) echo -e "\n\n${bold}Invalid option:${normal} ${i}" >&2 fail @@ -161,6 +168,7 @@ echo -e "\n\n${bold}Cloning project repo...${normal}\n\n" rm -rf "$REPONAME" git clone "https://github.com/sisoputnfrba/${REPONAME}.git" +git -C "$REPONAME" checkout "$BRANCH" echo -e "\n\n${bold}Building dependencies${normal}..."