webapp: check that the shim exists, and restart the assistant if not
This commit is contained in:
parent
df00c6166c
commit
860415aa5b
1 changed files with 3 additions and 2 deletions
|
@ -30,7 +30,9 @@ seek = [withFlag restartOption $ \restart -> withNothing $ start restart]
|
||||||
|
|
||||||
start :: Bool -> CommandStart
|
start :: Bool -> CommandStart
|
||||||
start restart = notBareRepo $ do
|
start restart = notBareRepo $ do
|
||||||
if restart
|
f <- liftIO . absPath =<< fromRepo gitAnnexHtmlShim
|
||||||
|
ok <- liftIO $ doesFileExist f
|
||||||
|
if restart || not ok
|
||||||
then do
|
then do
|
||||||
stopDaemon
|
stopDaemon
|
||||||
void $ liftIO . catchMaybeIO . removeFile
|
void $ liftIO . catchMaybeIO . removeFile
|
||||||
|
@ -40,7 +42,6 @@ start restart = notBareRepo $ do
|
||||||
r <- checkpid
|
r <- checkpid
|
||||||
when (r == Nothing) $
|
when (r == Nothing) $
|
||||||
startassistant
|
startassistant
|
||||||
f <- liftIO . absPath =<< fromRepo gitAnnexHtmlShim
|
|
||||||
let url = "file://" ++ f
|
let url = "file://" ++ f
|
||||||
ifM (liftIO $ runBrowser url)
|
ifM (liftIO $ runBrowser url)
|
||||||
( stop
|
( stop
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue