mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-11 03:28:09 +03:00
clean up watch.sh
This commit is contained in:
parent
1966878cbc
commit
45bafa7bba
@ -3,18 +3,17 @@ set -euo pipefail
|
||||
|
||||
if ! test -d public; then make public; fi
|
||||
|
||||
declare SERVER_PID
|
||||
|
||||
# wait for an interrupt and kill both of them
|
||||
cleanup() {
|
||||
if ! test -z "$SERVER_PID"; then kill "$SERVER_PID"; fi
|
||||
}
|
||||
trap cleanup EXIT INT
|
||||
|
||||
# start a web server
|
||||
./script/serve.sh public &
|
||||
SERVER_PID=$!
|
||||
|
||||
# start a watcher
|
||||
find src styleguide-app -type f -not -ipath '*elm-stuff*' | entr make public &
|
||||
WATCHER_PID=$!
|
||||
|
||||
# wait for an interrupt and kill both of them
|
||||
cleanup() {
|
||||
kill $SERVER_PID $WATCHER_PID
|
||||
}
|
||||
trap cleanup EXIT INT
|
||||
|
||||
while : ; do sleep 10; done
|
||||
# start a watcher. This loops forever, so we don't need to loop ourselves.
|
||||
find src styleguide-app -type f -not -ipath '*elm-stuff*' | entr -c -p make public
|
||||
|
Loading…
Reference in New Issue
Block a user