forked from tdammers/sprinkles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-devel.sh
executable file
·51 lines (47 loc) · 1.17 KB
/
run-devel.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Convenience script for interactive-ish development. Starts up some background
# processes to constantly update and restart things.
#
# Specifically:
# - Recompile on source change
# - Restart servers on relevant changes
# - Re-run tests on source change
# - Rebuild haddock on source change
# - Rebuild tags file on source change
function watch_serve() {
BASEDIR="$(realpath .)"
cd "$1"
for ((;;))
do
sleep 1
pgrep -l sprinkles
sprinkles "$2" &
PID="$!"
echo "$PID: $1 :$2"
pgrep -l sprinkles
inotifywait \
-e attrib \
"$(which sprinkles)" \
project.yml \
templates/** \
$(find -name static) \
"$BASEDIR"/run-devel.sh
sleep 1
kill "$PID"
done
}
function watch_hasktags() {
for ((;;))
do
inotifywait \
-e modify \
src/**/*.hs app/*.hs test
hasktags . -c
done
}
stack install # --test --haddock
watch_serve examples/blogg 5100 &
watch_serve examples/countryInfo 5101 &
watch_serve examples/playground 5102 &
watch_hasktags &
stack install --file-watch --test # --haddock