added auto-update for other Unixes

This commit is contained in:
Yann Esposito (Yogsototh) 2013-11-21 12:25:34 +01:00
parent 266b982038
commit 7143d8406c

View file

@ -10,7 +10,24 @@ relaunchCompilation() {
done
}
# launch a cabal install and cabal test after each
# small haskell file modification
{hobbes "*.hs" | relaunchCompilation } &
hobbes "*.cabal" | relaunchCompilation
case $(uname) in
Darwin)
# On mac OS X, use hobbes (cabal install hobbes)
# launch a cabal install and cabal test after each
# small haskell file modification
{hobbes "*.hs" | relaunchCompilation } &
hobbes "*.cabal" | relaunchCompilation
;;
*) # On other Unixes
currenttime=$(date +"%s")
while true; do
for fic in {src,test}/**/*.hs(.) *.cabal; do
# note to use on OS X, use "stat -f %m $checkfile" instead
modtime=$(stat --printf %Y $fic)
(( $modtime > $currenttime)) && print $fic
done
currenttime=$(date +"%s")
sleep 1
done | relaunchCompilation
;;
esac