bitque/jirs-client/scripts/run-wasm-pack.sh

25 lines
704 B
Bash
Raw Normal View History

2020-10-18 10:35:41 +02:00
#!/usr/bin/env bash
set -ex
. .env
rm -Rf tmp
mkdir -p tmp
mkdir -p target
2020-11-25 20:14:52 +01:00
cd ${CLIENT_ROOT}
wasm-pack --verbose build --mode ${MODE} ${BUILD_TYPE} --out-name jirs --out-dir ${CLIENT_ROOT}/build --target web
2020-10-18 10:35:41 +02:00
2020-11-25 20:14:52 +01:00
cd ${CLIENT_ROOT}
${PROJECT_ROOT}/target/debug/jirs-css -i ${CLIENT_ROOT}/js/styles.css -o ${CLIENT_ROOT}/tmp/styles.css
cp -r ${CLIENT_ROOT}/static/* ${CLIENT_ROOT}/tmp
2020-10-18 10:35:41 +02:00
2020-12-18 22:31:29 +01:00
cat ${CLIENT_ROOT}/static/index.js |
2020-10-18 10:35:41 +02:00
sed -e "s/process.env.JIRS_SERVER_BIND/'$JIRS_SERVER_BIND'/g" |
2020-11-25 20:14:52 +01:00
sed -e "s/process.env.JIRS_SERVER_PORT/'$JIRS_SERVER_PORT'/g" &>${CLIENT_ROOT}/tmp/index.js
2020-10-18 10:35:41 +02:00
2020-11-25 20:14:52 +01:00
cp ${CLIENT_ROOT}/build/*.{js,wasm} ${CLIENT_ROOT}/tmp/
cp ${CLIENT_ROOT}/js/template.html ${CLIENT_ROOT}/tmp/index.html