server : attempt use valid xxd command on linux
This commit is contained in:
parent
580e02e11e
commit
af4960a5a5
1 changed files with 9 additions and 1 deletions
|
@ -12,9 +12,17 @@ if [ "$1" != "--no-download" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FILES=$(ls $PUBLIC)
|
FILES=$(ls $PUBLIC)
|
||||||
|
UNAME_S=$(uname -s)
|
||||||
|
|
||||||
for FILE in $FILES; do
|
for FILE in $FILES; do
|
||||||
func=$(echo $FILE | tr '.' '_')
|
func=$(echo $FILE | tr '.' '_')
|
||||||
echo "generate $FILE.hpp ($func)"
|
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
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue