From d4bdcab3c8f41b09ce61806831a1a834f9e297cb Mon Sep 17 00:00:00 2001 From: nik Date: Mon, 24 Apr 2017 11:55:00 +0300 Subject: [PATCH] build scripts: enable 'nullglob' option in sh scripts Without this option '*' isn't expanded if nothing matches to the file pattern so the pattern will be passed to 'for' body as is. --- platform/build-scripts/tools/mac/scripts/signapp.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/build-scripts/tools/mac/scripts/signapp.sh b/platform/build-scripts/tools/mac/scripts/signapp.sh index b66c2834eb3e..d47fe2724fac 100644 --- a/platform/build-scripts/tools/mac/scripts/signapp.sh +++ b/platform/build-scripts/tools/mac/scripts/signapp.sh @@ -43,6 +43,9 @@ HELP_DIR=${EXPLODED}/"$BUILD_NAME"/Contents/Resources/"$HELP_FILE"/Contents/Reso echo "Building help indices for $HELP_DIR" hiutil -Cagvf "$HELP_DIR/search.helpindex" "$HELP_DIR" +#enable nullglob option to ensure that 'for' cycles don't iterate if nothing matches to the file pattern +shopt -s nullglob + for f in ${EXPLODED}/"$BUILD_NAME"/Contents/bin/*.jnilib ; do if [ -f "$f" ]; then b="$(basename "$f" .jnilib)" @@ -56,6 +59,7 @@ for f in ${EXPLODED}/"$BUILD_NAME"/Contents/*.txt ; do mv "$f" ${EXPLODED}/"$BUILD_NAME"/Contents/Resources fi done +shopt -u nullglob # Make sure *.p12 is imported into local KeyChain security unlock-keychain -p ${PASSWORD} /Users/${USERNAME}/Library/Keychains/login.keychain