summaryrefslogtreecommitdiff
path: root/Command/Watch.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-06-06 22:49:32 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-06-06 22:49:32 -0400
commitb8f85f7a82009f3480abaedae510b4db1c3b3f3a (patch)
tree6799a04c1a7ee6bf32008608a696c44ee15a6cb2 /Command/Watch.hs
parentc5b11561f0110c70454b6123ab64ac044c81a5c3 (diff)
build watch on non-linux, just don't do anything
Diffstat (limited to 'Command/Watch.hs')
-rw-r--r--Command/Watch.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/Command/Watch.hs b/Command/Watch.hs
index dcd411d43..478631100 100644
--- a/Command/Watch.hs
+++ b/Command/Watch.hs
@@ -5,6 +5,7 @@
- Licensed under the GNU GPL version 3 or higher.
-}
+{-# LANGUAGE CPP #-}
{-# LANGUAGE BangPatterns #-}
module Command.Watch where
@@ -25,9 +26,12 @@ import qualified Backend
import Annex.Content
import Control.Exception as E
-import System.INotify
import Control.Concurrent.MVar
+#if defined linux_HOST_OS
+import System.INotify
+#endif
+
def :: [Command]
def = [command "watch" paramPaths seek "watch for changes"]
@@ -35,6 +39,7 @@ seek :: [CommandSeek]
seek = [withNothing start]
start :: CommandStart
+#if defined linux_HOST_OS
start = notBareRepo $ do
showStart "watch" "."
showAction "scanning"
@@ -56,6 +61,10 @@ start = notBareRepo $ do
ignored ".gitattributes" = True
ignored _ = False
+#else
+start = error "watch mode is so far only available on Linux"
+#endif
+
{- Runs a handler, inside the Annex monad.
-
- Exceptions by the handlers are ignored, otherwise a whole watcher