diff --git a/git2zola.sh b/git2zola.sh index ad952d7..06b42a9 100755 --- a/git2zola.sh +++ b/git2zola.sh @@ -42,6 +42,8 @@ BASE_URL=${BASE_URL:-"http://docker.local:${SWSPORT}"} # Zola output build and sws path OUTPUT_DIR=${OUTPUT_DIR:-$HOME/$GITPROJECTUSER/$GITPROJECTNAME/public} +GITBRANCHNAME="master" + # set trap to exit this process # at this time only exit this process if it get a exit code trap "exit" EXIT @@ -112,7 +114,7 @@ getTheme () { if [ ! -d ./"${THEME_NAME}" ] then echo "clone theme with ${GITTHEMECLONEURL} ${THEME_NAME}" - git clone "${GITTHEMECLONEURL}" "${THEME_NAME}" master|| errorAndExit "can't clone theme" 3 + git clone -b "${GITBRANCHNAME}" "${GITTHEMECLONEURL}" "${THEME_NAME}" || errorAndExit "can't clone theme" 3 fi if [ -d ./"${THEME_NAME}" ] then @@ -165,7 +167,7 @@ zola --version echo "checking local repository directory" if [ ! -d "${GITPROJECTNAME}" ]; then echo "no local repository directory found, cloning ${GITPROJECTNAME} from ${GITCLONEURL}" - git clone "${GITCLONEURL}" master || exit 9 + git clone -b "${GITBRANCHNAME}" "${GITCLONEURL}" || exit 9 echo "change into project path ${GITPROJECTNAME}" cd "${GITPROJECTNAME}" || exit 6 getTheme