added auto-update for other Unixes
This commit is contained in:
parent
266b982038
commit
7143d8406c
1 changed files with 21 additions and 4 deletions
25
auto-update
25
auto-update
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue