diff --git a/examples/server/deps.sh b/examples/server/deps.sh index 4e5262ff9..512636bae 100755 --- a/examples/server/deps.sh +++ b/examples/server/deps.sh @@ -12,9 +12,17 @@ if [ "$1" != "--no-download" ]; then fi FILES=$(ls $PUBLIC) +UNAME_S=$(uname -s) for FILE in $FILES; do func=$(echo $FILE | tr '.' '_') echo "generate $FILE.hpp ($func)" - xxd -n $func -i $PUBLIC/$FILE > $DIR/$FILE.hpp + + if [ "$UNAME_S" == "Darwin" ]; then + xxd -n $func -i $PUBLIC/$FILE > $DIR/$FILE.hpp + elif [ "$UNAME_S" == "Linux" ]; then + xxd -i $PUBLIC/$FILE > $DIR/$FILE.hpp + replace_prefix="$(echo $PUBLIC | tr '/' '_')_" + sed -i "s/$replace_prefix//g" $DIR/$FILE.hpp + fi done