forked from LedgerHQ/app-tezos-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
watch.sh
executable file
·24 lines (17 loc) · 666 Bytes
/
watch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
set -uo pipefail
fail() { unset ___empty; : "${___empty:?$1}"; }
target="${1:?Please specify target, either 's' for Nano S or 'x' for Nano X}"
shift
[ -z "${1:-}" ] && fail "No command given; try running $0 make"
root="$(git rev-parse --show-toplevel)"
watchdirs=("$root/default.nix" "$root/nix" "$root/Makefile" "$root/src" "$root/icons")
inotifywait="$(nix-build "$root/nix/dep/nixpkgs" -A inotify-tools --no-out-link)/bin/inotifywait"
while true; do
"$root/nix/env.sh" "$target" "--run" "$@"
if ! "$inotifywait" -qre close_write "${watchdirs[@]}"; then
fail "inotifywait failed"
fi
echo "----------------------"
echo
done