ottobackwards commented on a change in pull request #1315: METRON-1956 add 
missing tests and some of the many shellcheck fixes
URL: https://github.com/apache/metron/pull/1315#discussion_r247950609
 
 

 ##########
 File path: dev-utilities/committer-utils/metron-committer-common
 ##########
 @@ -172,27 +172,27 @@ function setup_working_directory {
 #
 function setup_code {
     # if working directory does not exist, checkout the base branch
-    if [ ! -d "$WORK" ]; then
+    if [[ ! -d "$WORK" ]]; then
 
         REPO_NAME="metron"
-        if [ -n $1 ]; then
+        if [[ -n $1 ]]; then
             REPO_NAME=$1
         fi
 
         # origin repository
         ORIGIN="https://github.com/apache/${REPO_NAME}";
         read -p "  origin repo [$ORIGIN]: " INPUT
-        [ -n "$INPUT" ] && ORIGIN=${INPUT}
+        [[ -n "$INPUT" ]] && ORIGIN=${INPUT}
 
         # what branch did the PR get submitted against?  could be a feature 
branch
-        BASE_BRANCH=`curl -s 
https://api.github.com/repos/apache/${REPO_NAME}/pulls/${PR} | python -c 
'import sys, json; print json.load(sys.stdin)["base"]["ref"]'`
+        BASE_BRANCH=$(curl -s 
https://api.github.com/repos/apache/${REPO_NAME}/pulls/${PR} | python -c 
'import sys, json; print json.load(sys.stdin)["base"]["ref"]')
         read -p "  base branch to merge into [$BASE_BRANCH]: " INPUT
-        [ -n "$INPUT" ] && BASE_BRANCH=${INPUT}
+        [[ -n "$INPUT" ]] && BASE_BRANCH=${INPUT}
 
         # clone the repository and fetch updates
         mkdir -p ${WORK}
         git clone ${ORIGIN} ${WORK}
-        cd ${WORK} || exit "Failed to cd to ${WORK}"
+        cd ${WORK} &> /dev/null || echo "failed to change directory to 
${WORK}" && exit 1
 
 Review comment:
   done
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to