From 4e18e5e3a78806b47a94ce6e337366bf1893697c Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Sat, 27 May 2017 12:39:59 -0400 Subject: [PATCH] Fix jjb-verify to not fail on ls call The set -e configure fails the build when ls returns an error state. Rewrite the code such that it passes correctly and does not fail the build. Change-Id: Ib1e99dd3c8ce596610d5119b9fcdf01c626bcbdd Signed-off-by: Thanh Ha --- shell/jjb-verify-job.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/shell/jjb-verify-job.sh b/shell/jjb-verify-job.sh index cc0aa0b9..509b9533 100644 --- a/shell/jjb-verify-job.sh +++ b/shell/jjb-verify-job.sh @@ -21,11 +21,10 @@ jenkins-jobs -l DEBUG test --recursive -o archives/job-configs jjb/ pushd archives/job-configs for letter in {a..z} do - ls "$letter"* > /dev/null 2>&1 - if [[ "$?" -eq 0 ]] + if [[ $(ls "$letter"* > /dev/null 2>&1) -eq 0 ]] then mkdir "$letter" - find . -type f -maxdepth 1 -name "$letter*" -exec mv {} "$letter" \; + find . -maxdepth 1 -type f -name "$letter*" -exec mv {} "$letter" \; fi done popd -- 2.16.6