Skip to content

Commit f1c9995

Browse files
authored
Merge pull request #230 from sproctor/fix/mac-bashisms
fix empty argument errors
2 parents a8fbcc6 + 84d8553 commit f1c9995

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

.github/actions/build-macos-universal/build-universal.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,46 +201,46 @@ sign_app_bundle() {
201201
echo " [1/7] Signing .dylib files..."
202202
find "$app_path" -name '*.dylib' -type f | while IFS= read -r lib; do
203203
codesign --force --sign "$identity" --options runtime --timestamp \
204-
"${runtime_ent_args[@]}" "${kc_args[@]}" "$lib"
204+
${runtime_ent_args[@]+"${runtime_ent_args[@]}"} ${kc_args[@]+"${kc_args[@]}"} "$lib"
205205
done
206206

207207
echo " [2/7] Signing .jnilib files..."
208208
find "$app_path" -name '*.jnilib' -type f | while IFS= read -r lib; do
209209
codesign --force --sign "$identity" --options runtime --timestamp \
210-
"${runtime_ent_args[@]}" "${kc_args[@]}" "$lib"
210+
${runtime_ent_args[@]+"${runtime_ent_args[@]}"} ${kc_args[@]+"${kc_args[@]}"} "$lib"
211211
done
212212

213213
echo " [3/7] Signing main executables..."
214214
if [[ -d "$app_path/Contents/MacOS" ]]; then
215215
find "$app_path/Contents/MacOS" -type f -perm +111 | while IFS= read -r exe; do
216216
codesign --force --sign "$identity" --options runtime --timestamp \
217-
"${ent_args[@]}" "${kc_args[@]}" "$exe"
217+
${ent_args[@]+"${ent_args[@]}"} ${kc_args[@]+"${kc_args[@]}"} "$exe"
218218
done
219219
fi
220220

221221
echo " [4/7] Signing runtime executables..."
222222
if [[ -d "$app_path/Contents/runtime/Contents/Home/bin" ]]; then
223223
find "$app_path/Contents/runtime/Contents/Home/bin" -type f -perm +111 | while IFS= read -r exe; do
224224
codesign --force --sign "$identity" --options runtime --timestamp \
225-
"${runtime_ent_args[@]}" "${kc_args[@]}" "$exe"
225+
${runtime_ent_args[@]+"${runtime_ent_args[@]}"} ${kc_args[@]+"${kc_args[@]}"} "$exe"
226226
done
227227
fi
228228

229229
echo " [5/7] Signing frameworks..."
230230
find "$app_path" -name '*.framework' -type d | while IFS= read -r fw; do
231231
codesign --force --sign "$identity" --options runtime --timestamp \
232-
"${kc_args[@]}" "$fw"
232+
${kc_args[@]+"${kc_args[@]}"} "$fw"
233233
done
234234

235235
echo " [6/7] Signing runtime bundle..."
236236
if [[ -d "$app_path/Contents/runtime" ]]; then
237237
codesign --force --sign "$identity" --options runtime --timestamp \
238-
"${runtime_ent_args[@]}" "${kc_args[@]}" "$app_path/Contents/runtime"
238+
${runtime_ent_args[@]+"${runtime_ent_args[@]}"} ${kc_args[@]+"${kc_args[@]}"} "$app_path/Contents/runtime"
239239
fi
240240

241241
echo " [7/7] Signing .app bundle..."
242242
codesign --force --sign "$identity" --options runtime --timestamp \
243-
"${ent_args[@]}" "${kc_args[@]}" "$app_path"
243+
${ent_args[@]+"${ent_args[@]}"} ${kc_args[@]+"${kc_args[@]}"} "$app_path"
244244

245245
echo " Verifying signature..."
246246
codesign --verify --deep --strict --verbose=2 "$app_path"
@@ -571,7 +571,7 @@ if [[ -n "$INSTALLER_IDENTITY" && -n "$UNIVERSAL_SANDBOXED_APP" ]]; then
571571
productbuild \
572572
--component "$PKG_APP_COPY" "${INSTALL_LOCATION:-/Applications}" \
573573
--sign "$INSTALLER_IDENTITY" \
574-
"${PB_KC_ARGS[@]}" \
574+
${PB_KC_ARGS[@]+"${PB_KC_ARGS[@]}"} \
575575
"$OUTPUT_DIR/$PKG_NAME"
576576

577577
echo "==> Verifying PKG signature..."

0 commit comments

Comments
 (0)