mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-13 07:48:26 +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
|
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
|
# start a web server
|
||||||
./script/serve.sh public &
|
./script/serve.sh public &
|
||||||
SERVER_PID=$!
|
SERVER_PID=$!
|
||||||
|
|
||||||
# start a watcher
|
# 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 make public &
|
find src styleguide-app -type f -not -ipath '*elm-stuff*' | entr -c -p 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
|
|
||||||
|
Loading…
Reference in New Issue
Block a user