diff --git a/bin/watch-run b/bin/watch-run new file mode 100755 index 0000000..1f263a8 --- /dev/null +++ b/bin/watch-run @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if [ "$#" -lt 2 ]; then + >&2 echo "usage: $0 dir command [args]" + exit 1 +fi + +dir="$1"; shift +cmd=("$@") + +# I specifically want the command to expand here. +# +# shellcheck disable=SC2068 +until fd . "${dir}" | entr -dr ${cmd[@]}; do + echo 'Press Space or edit a file to re-run command' +done diff --git a/bin/watch-test b/bin/watch-test index c479a3e..be5926d 100755 --- a/bin/watch-test +++ b/bin/watch-test @@ -10,10 +10,9 @@ fi dir="$1"; shift cmd=("$@") -echo 'Press Space or edit a file to run tests' # I specifically want the command to expand here. # # shellcheck disable=SC2068 -until fd . "${dir}" | entr -cdpr ${cmd[@]}; do +until fd . "${dir}" | entr -cdr ${cmd[@]}; do echo 'Press Space or edit a file to re-run tests' done