diff options
author | Joey Hess <joey@kitenet.net> | 2013-11-17 14:58:35 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-11-17 14:58:35 -0400 |
commit | fd17f8e97390ffa72e90a4532c10f2848764c580 (patch) | |
tree | 3ff329e640a11b6c3ef62859896e7390dd23b1f7 /Command | |
parent | 9ed7e9be8f32b3795c5252641a11f3500a6dea28 (diff) |
webapp: Check annex.version.
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Watch.hs | 2 | ||||
-rw-r--r-- | Command/WebApp.hs | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/Command/Watch.hs b/Command/Watch.hs index 0b34b0f84..a33fc633c 100644 --- a/Command/Watch.hs +++ b/Command/Watch.hs @@ -32,5 +32,5 @@ start :: Bool -> Bool -> Bool -> Maybe Duration -> CommandStart start assistant foreground stopdaemon startdelay = do if stopdaemon then stopDaemon - else startDaemon assistant foreground startdelay Nothing Nothing -- does not return + else startDaemon assistant foreground startdelay Nothing Nothing Nothing -- does not return stop diff --git a/Command/WebApp.hs b/Command/WebApp.hs index 88c1537d0..70f28a113 100644 --- a/Command/WebApp.hs +++ b/Command/WebApp.hs @@ -30,6 +30,8 @@ import qualified Git.CurrentRepo import qualified Annex import Config.Files import qualified Option +import Upgrade +import Annex.Version import Control.Concurrent import Control.Concurrent.STM @@ -56,10 +58,14 @@ start = start' True start' :: Bool -> Maybe HostName -> CommandStart start' allowauto listenhost = do liftIO ensureInstalled - ifM isInitialized ( go , auto ) + ifM isInitialized + ( go + , auto + ) stop where go = do + cannotrun <- needsUpgrade . fromMaybe (error "no version") =<< getVersion browser <- fromRepo webBrowser f <- liftIO . absPath =<< fromRepo gitAnnexHtmlShim ifM (checkpid <&&> checkshim f) @@ -69,7 +75,7 @@ start' allowauto listenhost = do url <- liftIO . readFile =<< fromRepo gitAnnexUrlFile liftIO $ openBrowser browser f url Nothing Nothing - , startDaemon True True Nothing listenhost $ Just $ + , startDaemon True True Nothing cannotrun listenhost $ Just $ \origout origerr url htmlshim -> if isJust listenhost then maybe noop (`hPutStrLn` url) origout @@ -133,7 +139,7 @@ firstRun listenhost = do let callback a = Just $ a v runAssistant d $ do startNamedThread urlrenderer $ - webAppThread d urlrenderer True listenhost + webAppThread d urlrenderer True Nothing listenhost (callback signaler) (callback mainthread) waitNamedThreads @@ -155,7 +161,7 @@ firstRun listenhost = do _wait <- takeMVar v state <- Annex.new =<< Git.CurrentRepo.get Annex.eval state $ - startDaemon True True Nothing listenhost $ Just $ + startDaemon True True Nothing Nothing listenhost $ Just $ sendurlback v sendurlback v _origout _origerr url _htmlshim = do recordUrl url |