aw-lights/entr.sh

27 lines
383 B
Bash
Raw Normal View History

2021-07-31 14:29:21 -04:00
CMD="$(cat <<'EOF'
set -euo pipefail
HEIGHT="$(($(tput lines) - 1))"
clear
2021-08-21 14:02:08 -04:00
2021-08-21 15:24:21 -04:00
function cargo_cmd() {
cargo --color=always "${1}" |& head -n "${HEIGHT}"
}
2021-08-21 14:02:08 -04:00
(
2021-10-12 17:15:14 -04:00
cd ./webui/liveview-rust/js/
2021-08-21 14:02:08 -04:00
npm run-script build
2021-08-21 15:24:21 -04:00
) &
2021-08-21 14:02:08 -04:00
2021-08-21 15:24:21 -04:00
cargo_cmd fmt
cargo_cmd check &
wait
cargo_cmd build
cargo_cmd clippy
2021-07-31 14:29:21 -04:00
EOF
)"
{
2021-08-21 14:02:08 -04:00
fd -tf -ers -ehtml
fd -tf liveview-dev.js
2021-10-12 17:15:14 -04:00
fd -tf Cargo.toml
2021-07-31 14:29:21 -04:00
} | entr bash -c "${CMD}"