Skip to content

Commit 50d381b

Browse files
committed
add some checking
1 parent 1ae0f52 commit 50d381b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

ssc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ case "$(uname -s)" in
7878
*) echo "unsupported system"; exit 1;;
7979
esac
8080

81+
if [ "$SYSTEM" = Mac -a "$STATIC" = 1 ]; then
82+
echo "Linking statically is not supported on macOS. Please remove -s flag."
83+
exit 1
84+
fi
85+
if [ "$SYSTEM" != Linux -a -n "$SQUASHFS_DATA" ]; then
86+
echo "Mounting squashfs is only supported on Linux. Please remove -M flag."
87+
exit 1
88+
fi
89+
8190
if [ "$SYSTEM" = Termux ]; then
8291
LDFLAGS="$LDFLAGS -landroid-wordexp"
8392
if [ "$STATIC" = 1 ]; then
@@ -129,7 +138,7 @@ b2o() {
129138
# cleanup on exit
130139
trap "rm -f \"$1.cpp\" \"$1.tmp\" i.o i s.o s rc4 crc32 d.sfs" EXIT
131140

132-
perl -pe 's/^\xEF\xBB\xBF//; s/\r\n/\n/' "$1" >"$1.tmp"
141+
perl -pe 's/^\xEF\xBB\xBF//; s/\r\n/\n/' "$1" >"$1.tmp" || exit 1
133142
if [ "$(head -c2 "$1.tmp")" = "#!" ]; then
134143
SHEBANG="$(head -n1 "$1.tmp")"
135144
SHEBANG_LEN="$(head -n1 "$1.tmp" | wc -c)"

0 commit comments

Comments
 (0)