wasmbuild.bat 635 B

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