aw-lights/entr.sh
2021-08-21 15:24:21 -04:00

27 lines
386 B
Bash
Executable File

CMD="$(cat <<'EOF'
set -euo pipefail
HEIGHT="$(($(tput lines) - 1))"
clear
function cargo_cmd() {
cargo --color=always "${1}" |& head -n "${HEIGHT}"
}
(
cd ./liveview-rust/js/
npm run-script build
) &
cargo_cmd fmt
cargo_cmd check &
wait
cargo_cmd build
cargo_cmd clippy
EOF
)"
{
fd -tf -ers -ehtml
fd -tf liveview-dev.js
printf "%s\n" "Cargo.toml"
} | entr bash -c "${CMD}"