diff --git a/.circleci/config.yml b/.circleci/config.yml index 7102bbd..36c43cf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,22 +22,26 @@ jobs: - run: working_directory: my-site/themes/hugo-fresh command: | + set +e isPrIfGreaterThanZero=$(expr $CIRCLE_BRANCH : "pull") - if [ isPrIfGreaterThanZero > 0 ]; then + echo $isPrIfGreaterThanZero + if [ "$isPrIfGreaterThanZero" -gt "0" ]; then echo "Hello World $CIRCLE_BRANCH" git fetch origin ${CIRCLE_BRANCH}/head:BRANCHNAME git checkout BRANCHNAME else echo "Hello World else $CIRCLE_BRANCH" - git checkout ${CIRCLE_BRANCH} + git checkout $CIRCLE_BRANCH fi - run: name: Replace default config working_directory: my-site command: | + set +e isPrIfGreaterThanZero=$(expr $CIRCLE_BRANCH : "pull") - if [ isPrIfGreaterThanZero > 0 ]; then + echo $isPrIfGreaterThanZero + if [ "$isPrIfGreaterThanZero" -gt "0" ]; then branch=${CIRCLE_SHA1} else branch=${CIRCLE_BRANCH}