Skip to content

Commit af4960a

Browse files
committed
server : attempt use valid xxd command on linux
1 parent 580e02e commit af4960a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

examples/server/deps.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,17 @@ if [ "$1" != "--no-download" ]; then
1212
fi
1313

1414
FILES=$(ls $PUBLIC)
15+
UNAME_S=$(uname -s)
1516

1617
for FILE in $FILES; do
1718
func=$(echo $FILE | tr '.' '_')
1819
echo "generate $FILE.hpp ($func)"
19-
xxd -n $func -i $PUBLIC/$FILE > $DIR/$FILE.hpp
20+
21+
if [ "$UNAME_S" == "Darwin" ]; then
22+
xxd -n $func -i $PUBLIC/$FILE > $DIR/$FILE.hpp
23+
elif [ "$UNAME_S" == "Linux" ]; then
24+
xxd -i $PUBLIC/$FILE > $DIR/$FILE.hpp
25+
replace_prefix="$(echo $PUBLIC | tr '/' '_')_"
26+
sed -i "s/$replace_prefix//g" $DIR/$FILE.hpp
27+
fi
2028
done

0 commit comments

Comments
 (0)