Skip to content

Commit 9e777d7

Browse files
fix: use plain string for codesign flags instead of empty array (set -u unbound variable)
Co-authored-by: ansgarbecker <ansgarbecker@users.noreply.github.com>
1 parent 072bbb0 commit 9e777d7

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎create-macos-app.sh‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ NOTARY_PROFILE="${MACOS_NOTARY_PROFILE:-notarytool-profile}"
4747

4848
# codesign flags: hardened runtime + secure timestamp only make sense with a real identity
4949
if $DO_ADHOC; then
50-
SIGN_OPTS=()
50+
SIGN_OPTS=""
5151
else
52-
SIGN_OPTS=(--options runtime --timestamp)
52+
SIGN_OPTS="--options runtime --timestamp"
5353
fi
5454

5555
LOCALES_ZIP_URL="https://www.heidisql.com/downloads/locale/HeidiSQL-locale.zip"
@@ -118,7 +118,7 @@ mkdir -p "${APP_DIR}/Contents/Frameworks" # where we will put .dylib and .so f
118118
# Copy main executable
119119
cp "${EXECUTABLE_SRC}" "${EXECUTABLE_TRG}"
120120
chmod +x "${EXECUTABLE_TRG}"
121-
codesign --force "${SIGN_OPTS[@]}" --sign "${CODESIGN_IDENTITY}" "${EXECUTABLE_TRG}"
121+
codesign --force ${SIGN_OPTS} --sign "${CODESIGN_IDENTITY}" "${EXECUTABLE_TRG}"
122122

123123
# Minimal Info.plist (adjust identifiers/versions as needed)
124124
cat > "${APP_DIR}/Contents/Info.plist" <<EOF
@@ -343,11 +343,11 @@ echo "Done. Bundled app is at: ${APP_DIR}"
343343
echo "Signing embedded libraries..."
344344
find "${APP_DIR}/Contents" -type f \( -name "*.dylib" -o -name "*.so" \) | while read -r f; do
345345
echo " Signing ${f}"
346-
codesign --force "${SIGN_OPTS[@]}" --sign "${CODESIGN_IDENTITY}" "${f}"
346+
codesign --force ${SIGN_OPTS} --sign "${CODESIGN_IDENTITY}" "${f}"
347347
done
348348

349349
echo "Signing main app bundle..."
350-
codesign --force "${SIGN_OPTS[@]}" --deep --sign "${CODESIGN_IDENTITY}" "${APP_DIR}"
350+
codesign --force ${SIGN_OPTS} --sign --deep --sign "${CODESIGN_IDENTITY}" "${APP_DIR}"
351351

352352
echo "Verifying code signature..."
353353
codesign --verify --deep --strict --verbose=2 "${APP_DIR}"

0 commit comments

Comments
 (0)