Skip to content

Commit 2603149

Browse files
committed
macos_bundle_libs.sh: skip scripts for dylibbundle
do not run dylibbundler on shell scripts
1 parent 0bc1215 commit 2603149

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

data/scripts/macos_bundle_libs.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,19 @@ bundle=$3
66

77
rpath=@executable_path/../libs/
88

9+
# check if first 2 bytes is shebang ('#' and '!')
10+
starts_with_shebang() {
11+
tmpf=${TMPDIR-/tmp}/ug-macos-bundle-sb-check$$
12+
od -N2 -td1 -An "$1" > "$tmpf"
13+
read -r first second < "$tmpf"
14+
rm -f "$tmpf"
15+
[ "$first" -eq 35 ] && [ "$second" -eq 33 ]
16+
}
17+
918
for n in "$bundle"/Contents/MacOS/*; do
19+
if starts_with_shebang "$n"; then
20+
continue
21+
fi
1022
# shellcheck disable=SC2086 # intentional, even $dylibbundler
1123
# can have flags like 'dylibbundler -f'; obvious for _flags
1224
echo quit | $dylibbundler $dylibbundler_flags -of -cd -b \

0 commit comments

Comments
 (0)