scripts: fix ad-hoc signing crashes and bash unbound variable error
This commit is contained in:
@@ -83,7 +83,10 @@ case "$TIMESTAMP_MODE" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
options_args=("--options" "runtime")
|
options_args=()
|
||||||
|
if [[ "$IDENTITY" != "-" ]]; then
|
||||||
|
options_args=("--options" "runtime")
|
||||||
|
fi
|
||||||
timestamp_args=("$timestamp_arg")
|
timestamp_args=("$timestamp_arg")
|
||||||
|
|
||||||
cat > "$ENT_TMP_BASE" <<'PLIST'
|
cat > "$ENT_TMP_BASE" <<'PLIST'
|
||||||
@@ -157,12 +160,12 @@ xattr -cr "$APP_BUNDLE" 2>/dev/null || true
|
|||||||
sign_item() {
|
sign_item() {
|
||||||
local target="$1"
|
local target="$1"
|
||||||
local entitlements="$2"
|
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() {
|
sign_plain_item() {
|
||||||
local target="$1"
|
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
|
# Sign main binary
|
||||||
|
|||||||
Reference in New Issue
Block a user