1
0

deps.sh 543 B

123456789101112131415161718
  1. #!/bin/bash
  2. # Download and update deps for binary
  3. # get the directory of this script file
  4. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
  5. PUBLIC=$DIR/public
  6. echo "download js bundle files"
  7. curl https://npm.reversehttp.com/@preact/signals-core,@preact/signals,htm/preact,preact,preact/hooks > $PUBLIC/index.js
  8. echo >> $PUBLIC/index.js # add newline
  9. FILES=$(ls $PUBLIC)
  10. for FILE in $FILES; do
  11. func=$(echo $FILE | tr '.' '_')
  12. echo "generate $FILE.hpp ($func)"
  13. xxd -n $func -i $PUBLIC/$FILE > $DIR/$FILE.hpp
  14. done