diff options
author | 2012-08-01 16:34:17 -0400 | |
---|---|---|
committer | 2012-08-01 16:34:17 -0400 | |
commit | ca512f1450d919397b6eb4fbc54e32e70677c8f7 (patch) | |
tree | 0f09c565c04798a8d158c93ded065cc68d227123 /Command | |
parent | 7606f3e7c1cc1b13445d04d11372c197fb6a3f13 (diff) |
always run webapp in foreground
Diffstat (limited to 'Command')
-rw-r--r-- | Command/WebApp.hs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Command/WebApp.hs b/Command/WebApp.hs index 61de2c2f1..20b914b7a 100644 --- a/Command/WebApp.hs +++ b/Command/WebApp.hs @@ -25,16 +25,15 @@ import Control.Concurrent.STM def :: [Command] def = [oneShot $ noRepo firstRun $ dontCheck repoExists $ - withOptions [Command.Watch.foregroundOption, Command.Watch.stopOption] $ + withOptions [Command.Watch.stopOption] $ command "webapp" paramNothing seek "launch webapp"] seek :: [CommandSeek] seek = [withFlag Command.Watch.stopOption $ \stopdaemon -> - withFlag Command.Watch.foregroundOption $ \foreground -> - withNothing $ start foreground stopdaemon] + withNothing $ start stopdaemon] -start :: Bool -> Bool -> CommandStart -start foreground stopdaemon = notBareRepo $ do +start :: Bool -> CommandStart +start stopdaemon = notBareRepo $ do if stopdaemon then stopDaemon else ifM (isInitialized) ( go , liftIO firstRun ) @@ -44,7 +43,7 @@ start foreground stopdaemon = notBareRepo $ do f <- liftIO . absPath =<< fromRepo gitAnnexHtmlShim ifM (checkpid <&&> checkshim f) $ ( liftIO $ openBrowser f - , startDaemon True foreground $ Just $ + , startDaemon True True $ Just $ const openBrowser ) checkpid = do @@ -84,10 +83,7 @@ firstRun = do where signaler v = do putMVar v "" - putStrLn "signaler waiting..." - r <- takeMVar v - putStrLn "signaler got value" - return r + takeMVar v mainthread v _url htmlshim = do openBrowser htmlshim |