build watch on non-linux, just don't do anything
This commit is contained in:
parent
c5b11561f0
commit
b8f85f7a82
2 changed files with 10 additions and 3 deletions
|
@ -5,6 +5,7 @@
|
||||||
- Licensed under the GNU GPL version 3 or higher.
|
- Licensed under the GNU GPL version 3 or higher.
|
||||||
-}
|
-}
|
||||||
|
|
||||||
|
{-# LANGUAGE CPP #-}
|
||||||
{-# LANGUAGE BangPatterns #-}
|
{-# LANGUAGE BangPatterns #-}
|
||||||
|
|
||||||
module Command.Watch where
|
module Command.Watch where
|
||||||
|
@ -25,9 +26,12 @@ import qualified Backend
|
||||||
import Annex.Content
|
import Annex.Content
|
||||||
|
|
||||||
import Control.Exception as E
|
import Control.Exception as E
|
||||||
import System.INotify
|
|
||||||
import Control.Concurrent.MVar
|
import Control.Concurrent.MVar
|
||||||
|
|
||||||
|
#if defined linux_HOST_OS
|
||||||
|
import System.INotify
|
||||||
|
#endif
|
||||||
|
|
||||||
def :: [Command]
|
def :: [Command]
|
||||||
def = [command "watch" paramPaths seek "watch for changes"]
|
def = [command "watch" paramPaths seek "watch for changes"]
|
||||||
|
|
||||||
|
@ -35,6 +39,7 @@ seek :: [CommandSeek]
|
||||||
seek = [withNothing start]
|
seek = [withNothing start]
|
||||||
|
|
||||||
start :: CommandStart
|
start :: CommandStart
|
||||||
|
#if defined linux_HOST_OS
|
||||||
start = notBareRepo $ do
|
start = notBareRepo $ do
|
||||||
showStart "watch" "."
|
showStart "watch" "."
|
||||||
showAction "scanning"
|
showAction "scanning"
|
||||||
|
@ -56,6 +61,10 @@ start = notBareRepo $ do
|
||||||
ignored ".gitattributes" = True
|
ignored ".gitattributes" = True
|
||||||
ignored _ = False
|
ignored _ = False
|
||||||
|
|
||||||
|
#else
|
||||||
|
start = error "watch mode is so far only available on Linux"
|
||||||
|
#endif
|
||||||
|
|
||||||
{- Runs a handler, inside the Annex monad.
|
{- Runs a handler, inside the Annex monad.
|
||||||
-
|
-
|
||||||
- Exceptions by the handlers are ignored, otherwise a whole watcher
|
- Exceptions by the handlers are ignored, otherwise a whole watcher
|
||||||
|
|
|
@ -5,8 +5,6 @@
|
||||||
- Licensed under the GNU GPL version 3 or higher.
|
- Licensed under the GNU GPL version 3 or higher.
|
||||||
-}
|
-}
|
||||||
|
|
||||||
{-# LANGUAGE CPP #-}
|
|
||||||
|
|
||||||
module Utility.Inotify where
|
module Utility.Inotify where
|
||||||
|
|
||||||
import Common hiding (isDirectory)
|
import Common hiding (isDirectory)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue