From d626a784f3a6e5b48258c7ea67b329c5d1dedaca Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 Mar 2014 13:43:56 -0400 Subject: [PATCH] webapp: detect on first run if git is not installed, and tell the user, rather than crashing non-informatively Mostly for Windows, which has no sane package management.. --- Assistant/WebApp/Configurators/Local.hs | 2 ++ Command/WebApp.hs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Assistant/WebApp/Configurators/Local.hs b/Assistant/WebApp/Configurators/Local.hs index 99592f6c39..9373116bde 100644 --- a/Assistant/WebApp/Configurators/Local.hs +++ b/Assistant/WebApp/Configurators/Local.hs @@ -160,6 +160,8 @@ getFirstRepositoryR :: Handler Html getFirstRepositoryR = postFirstRepositoryR postFirstRepositoryR :: Handler Html postFirstRepositoryR = page "Getting started" (Just Configuration) $ do + unlessM (liftIO $ inPath "git") $ + error "You need to install git in order to use git-annex!" #ifdef __ANDROID__ androidspecial <- liftIO $ doesDirectoryExist "/sdcard/DCIM" let path = "/sdcard/annex" diff --git a/Command/WebApp.hs b/Command/WebApp.hs index ee5998c9ad..91c9afcd0f 100644 --- a/Command/WebApp.hs +++ b/Command/WebApp.hs @@ -163,7 +163,8 @@ firstRun listenhost = do hFlush stdout go | otherwise = do - browser <- maybe Nothing webBrowser <$> Git.Config.global + browser <- maybe Nothing webBrowser + <$> catchDefaultIO Nothing Git.Config.global openBrowser browser htmlshim url Nothing Nothing go where