wasmbuild.bat 604 B

123456789101112131415161718192021
  1. @ECHO OFF
  2. CALL :Stage chapter-01-hellorust
  3. CALL :Stage chapter-02-helloecs
  4. REM Publish or perish
  5. cd book\book\wasm
  6. pscp -r * herbert@172.16.10.193:/var/www/bfnightly/rustbook/wasm
  7. cd ..\..\..
  8. EXIT /B 0
  9. REM Usage: Stage Chapter
  10. :Stage
  11. cd %~1
  12. cargo build --release --target wasm32-unknown-unknown
  13. wasm-bindgen ..\target\wasm32-unknown-unknown\release\%~1.wasm --out-dir ../book/book/wasm/%~1 --no-modules --no-typescript
  14. cd ..
  15. move .\book\book\wasm\%~1\%~1.js .\book\book\wasm\%~1\myblob.js
  16. move .\book\book\wasm\%~1\%~1_bg.wasm ./book/book/wasm/%~1/myblob_bg.wasm
  17. copy index.html .\book\book\wasm\%~1