summaryrefslogtreecommitdiff
path: root/Command/WebApp.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-26 11:52:49 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-26 11:52:49 -0400
commitcccdb448749de70d1769ecef79605e4f389f9c5d (patch)
treed7848f272ac1141c97df3923478036fcb7434ca5 /Command/WebApp.hs
parentc4830aaa6cfd9b43f5a8c77975c6b6acf867a21a (diff)
git annex webapp --force forces a restart of the daemon
Useful for testing..
Diffstat (limited to 'Command/WebApp.hs')
-rw-r--r--Command/WebApp.hs16
1 files changed, 12 insertions, 4 deletions
diff --git a/Command/WebApp.hs b/Command/WebApp.hs
index 0e01a07cd..e94338a2f 100644
--- a/Command/WebApp.hs
+++ b/Command/WebApp.hs
@@ -11,7 +11,7 @@ import Common.Annex
import Command
import Assistant
import Utility.WebApp
-import Utility.Daemon
+import Utility.Daemon (checkDaemon)
import qualified Annex
import Control.Concurrent
@@ -25,9 +25,17 @@ seek = [withNothing start]
start :: CommandStart
start = notBareRepo $ do
- r <- checkpid
- when (r == Nothing) $
- startassistant
+ ifM (Annex.getState Annex.force)
+ ( do
+ stopDaemon
+ liftIO . catchMaybeIO . removeFile
+ =<< fromRepo gitAnnexPidFile
+ startassistant
+ , do
+ r <- checkpid
+ when (r == Nothing) $
+ startassistant
+ )
f <- liftIO . absPath =<< fromRepo gitAnnexHtmlShim
let url = "file://" ++ f
ifM (liftIO $ runBrowser url)