bitque/crates/web/scripts/dev.sh

49 lines
1.1 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
ROOT=$(git rev-parse --show-toplevel)
RSASS_PATH=$(command -v rsass)
2021-04-15 22:32:05 +02:00
if [[ "${RSASS_PATH}" == "" ]]; then
cargo install rsass-cli
RSASS_PATH=$(command -v rsass)
fi
WASM_PACK_PATH=$(command -v wasm-pack)
2021-04-15 22:32:05 +02:00
if [[ "${WASM_PACK_PATH}" == "" ]]; then
cargo install wasm-pack
WASM_PACK_PATH=$(command -v wasm-pack)
fi
TRUNK_PATH=$(command -v trunk)
if [[ "${TRUNK_PATH}" == "" ]]; then
cargo install --locked trunk
TRUNK_PATH=$(command -v trunk)
fi
CARGO_WATCH=$(command -v cargo-watch)
if [[ "${CARGO_WATCH}" == "" ]]; then
cargo install cargo-watch
fi
2020-11-25 20:14:52 +01:00
export PROJECT_ROOT=$(git rev-parse --show-toplevel)
export CLIENT_ROOT=${PROJECT_ROOT}/crates/web
export HI_ROOT=${PROJECT_ROOT}/crates/highlight/bitque-highlight
2020-11-25 20:14:52 +01:00
export MODE=force
export BUILD_TYPE=--dev
2021-10-08 16:31:34 +02:00
export COPY_TO=${CLIENT_ROOT}/tmp
2021-10-05 14:34:20 +02:00
echo $PROJECT_ROOT
echo $CLIENT_ROOT
2020-10-18 10:35:41 +02:00
cd ${CLIENT_ROOT}
. ${ROOT}/.env
2020-11-25 20:14:52 +01:00
cargo watch \
2021-10-05 14:34:20 +02:00
-i ${CLIENT_ROOT}/src/location.rs \
2020-11-25 20:14:52 +01:00
-s ${CLIENT_ROOT}/scripts/run-wasm-pack.sh \
-w ${CLIENT_ROOT}/src \
-w ${CLIENT_ROOT}/Cargo.toml \
2021-10-05 14:34:20 +02:00
-w ${CLIENT_ROOT}/static \
-w ${CLIENT_ROOT}/js