From fe5e58af91fec3d3af968ddfab3fa748aa1487aa Mon Sep 17 00:00:00 2001 From: Petter Blomberg Date: Thu, 1 Jan 2026 15:29:01 +0100 Subject: [PATCH] scripts: fix ad-hoc signing crashes and bash unbound variable error --- scripts/codesign-mac-app.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/codesign-mac-app.sh b/scripts/codesign-mac-app.sh index 8bb1d7eed..3d558fb65 100755 --- a/scripts/codesign-mac-app.sh +++ b/scripts/codesign-mac-app.sh @@ -83,7 +83,10 @@ case "$TIMESTAMP_MODE" in ;; esac -options_args=("--options" "runtime") +options_args=() +if [[ "$IDENTITY" != "-" ]]; then + options_args=("--options" "runtime") +fi timestamp_args=("$timestamp_arg") cat > "$ENT_TMP_BASE" <<'PLIST' @@ -157,12 +160,12 @@ xattr -cr "$APP_BUNDLE" 2>/dev/null || true sign_item() { local target="$1" local entitlements="$2" - codesign --force "${options_args[@]}" "${timestamp_args[@]}" --entitlements "$entitlements" --sign "$IDENTITY" "$target" + codesign --force ${options_args+"${options_args[@]}"} "${timestamp_args[@]}" --entitlements "$entitlements" --sign "$IDENTITY" "$target" } sign_plain_item() { local target="$1" - codesign --force "${options_args[@]}" "${timestamp_args[@]}" --sign "$IDENTITY" "$target" + codesign --force ${options_args+"${options_args[@]}"} "${timestamp_args[@]}" --sign "$IDENTITY" "$target" } # Sign main binary