diff options
author | 2012-07-26 14:26:35 -0400 | |
---|---|---|
committer | 2012-07-26 14:27:32 -0400 | |
commit | 860415aa5b1d1c367a8a4810ef29e4a9417b0989 (patch) | |
tree | bf75558b34f09241992e1af938e2021ff802540b /Command/WebApp.hs | |
parent | df00c6166c55e7287914706fed9323ed3bf3ac1a (diff) |
webapp: check that the shim exists, and restart the assistant if not
Diffstat (limited to 'Command/WebApp.hs')
-rw-r--r-- | Command/WebApp.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Command/WebApp.hs b/Command/WebApp.hs index 3730e1419..653363440 100644 --- a/Command/WebApp.hs +++ b/Command/WebApp.hs @@ -30,7 +30,9 @@ seek = [withFlag restartOption $ \restart -> withNothing $ start restart] start :: Bool -> CommandStart start restart = notBareRepo $ do - if restart + f <- liftIO . absPath =<< fromRepo gitAnnexHtmlShim + ok <- liftIO $ doesFileExist f + if restart || not ok then do stopDaemon void $ liftIO . catchMaybeIO . removeFile @@ -40,7 +42,6 @@ start restart = notBareRepo $ do r <- checkpid when (r == Nothing) $ startassistant - f <- liftIO . absPath =<< fromRepo gitAnnexHtmlShim let url = "file://" ++ f ifM (liftIO $ runBrowser url) ( stop |