summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-06-10 17:40:35 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-06-10 17:40:35 -0400
commitcda6c4dff5cfa4733198ab87096235d81fce65d6 (patch)
treef3dad28916b3f51fa696fb32b4ef1944928d2069 /Command
parentf4aacd5c8659d7638eb98fcdd9b3909de782569f (diff)
tweak
Diffstat (limited to 'Command')
-rw-r--r--Command/Watch.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/Command/Watch.hs b/Command/Watch.hs
index 34282e46c..92ebb6d70 100644
--- a/Command/Watch.hs
+++ b/Command/Watch.hs
@@ -39,12 +39,17 @@ seek :: [CommandSeek]
seek = [withNothing start]
start :: CommandStart
-#if defined linux_HOST_OS
start = notBareRepo $ do
showStart "watch" "."
+ watch
+ stop
+
+watch :: Annex ()
+#if defined linux_HOST_OS
+watch = do
showAction "scanning"
inRepo $ Git.Command.run "add" [Param "--update"]
- next $ next $ withStateMVar $ \st -> liftIO $ withINotify $ \i -> do
+ withStateMVar $ \st -> liftIO $ withINotify $ \i -> do
changechan <- atomically newTChan
_ <- forkIO $ commitThread st changechan
let hook a = Just $ runHook st changechan a
@@ -58,9 +63,8 @@ start = notBareRepo $ do
watchDir i "." (ignored . takeFileName) hooks
putStrLn "(started)"
waitForTermination
- return True
#else
-start = error "watch mode is so far only available on Linux"
+watch = error "watch mode is so far only available on Linux"
#endif
ignored :: FilePath -> Bool