]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
replace test ([ expression ]) with bash internal [[ expression ]]
authorTobias von der Krone <tobias.vonderkrone@profitbricks.com>
Mon, 29 Jul 2013 07:29:01 +0000 (09:29 +0200)
committerTobias von der Krone <tobias.vonderkrone@profitbricks.com>
Mon, 29 Jul 2013 07:29:01 +0000 (09:29 +0200)
maven_pre_build_debian_wrapper.sh

index bd3db73d2a986c1cc6d0ad36bb398dc395d72dab..93445e56a0ea7b5018effe9770d7757acbeaca17 100755 (executable)
@@ -14,7 +14,7 @@ set -e
 
 cd $WORKSPACE
 # remove old maven repository if exists
-[ -d .repository ] && rm .repository -rf && echo "$WORKSPACE/.repository (used by Maven) removed"
+[[ -d .repository ]] && rm .repository -rf && echo "$WORKSPACE/.repository (used by Maven) removed"
 # clean up git
 git reset --hard
 # respect build-triggers (triggered from a git commit message containing the string [no-test])
@@ -28,7 +28,7 @@ figlet "$GIT_BRANCH_NAME"
 git checkout $GIT_BRANCH_NAME
 git status
 
-if [ ${GIT_BRANCH_NAME:0:8} = "feature/" ] || [ ${GIT_BRANCH_NAME:0:7} = "bugfix/" ]; then
+if [[ ${GIT_BRANCH_NAME:0:8} = "feature/" ]] || [[ ${GIT_BRANCH_NAME:0:7} = "bugfix/" ]]; then
     if [[ "$BUILD_TRIGGERS" == *"merge"* ]]; then
         #
         # if triggered  to 'merge' via git commit,
@@ -42,7 +42,7 @@ if [ ${GIT_BRANCH_NAME:0:8} = "feature/" ] || [ ${GIT_BRANCH_NAME:0:7} = "bugfix
         figlet "integration merge"
         git merge --no-ff origin/$GIT_BRANCH_NAME
     fi
-elif [ "$GIT_BRANCH_NAME" = "master" ] || [ "${GIT_BRANCH_NAME:0:7}" = "hotfix/" ]; then
+elif [[ "$GIT_BRANCH_NAME" = "master" ]] || [[ "${GIT_BRANCH_NAME:0:7}" = "hotfix/" ]]; then
     #
     # check whether we will able to 'git tag' after the build by trying it now
     #