-
Notifications
You must be signed in to change notification settings - Fork 4
/
cc.sh
executable file
·21 lines (14 loc) · 923 Bytes
/
cc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /usr/bin/env nix-shell
#! nix-shell --pure -i bash -p nix bash rsync
set -eu
source ./nix-shell-init.sh
app=$(basename *.cabal .cabal)
test -e dist || (mkdir dist && mkdir dist/build && mkdir dist/build/$app)
while true; do
printf '\033\143' #clear
nix-shell --run "cabal configure --ghcjs && time cabal build $@; true"
# used by ghcjsi repl
test -f dist/build/$app/$app.jsexe/all.js && sed -i 's/h$main(h$mainZCZCMainzimain);/module.exports = { h$main: h$main, h$killThread: h$killThread, h$d: h$d, h$baseZCControlziExceptionziBasezinonTermination: h$baseZCControlziExceptionziBasezinonTermination };h$main(h$mainZCZCMainzimain);/g' dist/build/$app/$app.jsexe/all.js
rsync --checksum dist/build/$app/$app.jsexe/all.js rnproject/
nix-shell -p fswatch --run "fswatch -1 -r -i '.*[.]hs$' --event Created --event Updated --event Removed --event Renamed --event MovedFrom --event MovedTo src; true"
done