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 <thanh.ha@linuxfoundation.org>
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