diff --git a/resources/apply_format.sh b/resources/apply_format.sh index 4191d10..2e12837 100755 --- a/resources/apply_format.sh +++ b/resources/apply_format.sh @@ -26,7 +26,7 @@ # set -e -if [ -z "$SELFDIR" ]; +if [[ -z "$SELFDIR" ]]; then echo "SELFDIR not defined" exit 1 diff --git a/resources/apply_license.sh b/resources/apply_license.sh index d4fd8fa..8fd6371 100755 --- a/resources/apply_license.sh +++ b/resources/apply_license.sh @@ -30,7 +30,7 @@ # set -e -if [ -z "$SELFDIR" ]; +if [[ -z "$SELFDIR" ]]; then echo "SELFDIR not defined" exit 1 diff --git a/resources/check_format.sh b/resources/check_format.sh index 231e353..78f3c2a 100755 --- a/resources/check_format.sh +++ b/resources/check_format.sh @@ -22,7 +22,7 @@ ## set -e -if [ -z "$SELFDIR" ]; +if [[ -z "$SELFDIR" ]]; then echo "$SELFDIR not defined" exit 1 @@ -36,7 +36,7 @@ echo "Check format from root: $SELFDIR" ./resources/apply_license.sh changed=$(git status --porcelain=1) -if [ -n "${changed}" ]; then +if [[ -n "${changed}" ]]; then echo "Error: Files changed after formatting:" git diff exit 1 diff --git a/resources/deps.sh b/resources/deps.sh index ca99488..11e9a96 100755 --- a/resources/deps.sh +++ b/resources/deps.sh @@ -26,7 +26,7 @@ # set -e -if [ -z "$SELFDIR" ] +if [[ -z "$SELFDIR" ]] then echo "SELFDIR not defined" exit 1 @@ -42,7 +42,7 @@ mkdir -p ${BUILDDIR} # Note: This checks for existence of qcbor, and if exists # then skips rebuilding it. -if [ ! -e ${DESTDIR}${PREFIX}/include/qcbor ] +if [[ ! -e ${DESTDIR}${PREFIX}/include/qcbor ]] then echo "Building QCBOR..." pushd ${DEPSDIR}/QCBOR @@ -59,7 +59,7 @@ fi # Note: This checks for existence of this path, skips building # if already exists. -if [ ! -e ${DESTDIR}${PREFIX}/include/m-lib ] +if [[ ! -e ${DESTDIR}${PREFIX}/include/m-lib ]] then echo "Building MLIB..." rsync --recursive ${DEPSDIR}/mlib/ ${BUILDDIR}/mlib/ @@ -73,7 +73,7 @@ fi # Note: Skips building unity if this path already exists. -if [ ! -e ${DESTDIR}${PREFIX}/include/unity ] +if [[ ! -e ${DESTDIR}${PREFIX}/include/unity ]] then echo "Building Unity..." pushd ${DEPSDIR}/unity diff --git a/resources/prep.sh b/resources/prep.sh index f4d6d9d..70a1655 100755 --- a/resources/prep.sh +++ b/resources/prep.sh @@ -26,7 +26,7 @@ # set -e -if [ -z "$SELFDIR" ] +if [[ -z "$SELFDIR" ]] then echo "SELFDIR not defined" exit 1