improve build scripts

- use shebang
- use pushd/popd
- add npm install to initialize node project dependencies
This commit is contained in:
2025-10-18 18:40:27 +02:00
parent 70df806a87
commit 658efd30bb
3 changed files with 18 additions and 6 deletions

View File

@@ -1,11 +1,15 @@
#!/usr/bin/env bash
rm ./src/webserver/index.html.gz
rm ./src/webserver/bundle.js.gz
set -e
cd ./src_webpack/
pushd ./src_webpack/
npm install
npx webpack build
cp index.html.gz ../src/webserver/index.html.gz
cp bundle.js.gz ../src/webserver/bundle.js.gz
cd ../
popd
cargo build --release
espflash save-image --bootloader bootloader.bin --partition-table partitions.csv --chip esp32c6 target/riscv32imac-unknown-none-elf/release/plant-ctrl2 image.bin

View File

@@ -1,11 +1,15 @@
#!/usr/bin/env bash
rm ./src/webserver/index.html.gz
rm ./src/webserver/bundle.js.gz
set -e
cd ./src_webpack/
pushd ./src_webpack/
npm install
npx webpack build
cp index.html.gz ../src/webserver/index.html.gz
cp bundle.js.gz ../src/webserver/bundle.js.gz
cd ../
popd
cargo build --release
espflash flash --monitor --bootloader bootloader.bin --chip esp32c6 --baud 921600 --partition-table partitions.csv target/riscv32imac-unknown-none-elf/release/plant-ctrl2

View File

@@ -1,12 +1,16 @@
#!/usr/bin/env bash
rm image.bin
rm ./src/webserver/index.html.gz
rm ./src/webserver/bundle.js.gz
set -e
cd ./src_webpack/
pushd ./src_webpack/
npm install
npx webpack build
cp index.html.gz ../src/webserver/index.html.gz
cp bundle.js.gz ../src/webserver/bundle.js.gz
cd ../
popd
set -e
cargo build --release