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..
This commit is contained in:
parent
ba4df0f112
commit
d626a784f3
2 changed files with 4 additions and 1 deletions
|
@ -160,6 +160,8 @@ getFirstRepositoryR :: Handler Html
|
||||||
getFirstRepositoryR = postFirstRepositoryR
|
getFirstRepositoryR = postFirstRepositoryR
|
||||||
postFirstRepositoryR :: Handler Html
|
postFirstRepositoryR :: Handler Html
|
||||||
postFirstRepositoryR = page "Getting started" (Just Configuration) $ do
|
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__
|
#ifdef __ANDROID__
|
||||||
androidspecial <- liftIO $ doesDirectoryExist "/sdcard/DCIM"
|
androidspecial <- liftIO $ doesDirectoryExist "/sdcard/DCIM"
|
||||||
let path = "/sdcard/annex"
|
let path = "/sdcard/annex"
|
||||||
|
|
|
@ -163,7 +163,8 @@ firstRun listenhost = do
|
||||||
hFlush stdout
|
hFlush stdout
|
||||||
go
|
go
|
||||||
| otherwise = do
|
| otherwise = do
|
||||||
browser <- maybe Nothing webBrowser <$> Git.Config.global
|
browser <- maybe Nothing webBrowser
|
||||||
|
<$> catchDefaultIO Nothing Git.Config.global
|
||||||
openBrowser browser htmlshim url Nothing Nothing
|
openBrowser browser htmlshim url Nothing Nothing
|
||||||
go
|
go
|
||||||
where
|
where
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue