webapp: display message about starting web browser

One reason to do this is that on OSX, it doesn't jump to the web browser
when opening a new page. Linux seems ahead in usability here... :P
This commit is contained in:
Joey Hess 2012-10-11 15:19:48 -04:00
parent 4ef6dac5c2
commit 80b3952930

View file

@ -133,8 +133,11 @@ openBrowser :: Maybe FilePath -> FilePath -> IO ()
openBrowser cmd htmlshim = go $ maybe runBrowser runCustomBrowser cmd
where
url = fileUrl htmlshim
go a = unlessM (a url) $
error $ "failed to start web browser on url " ++ url
go a = do
putStrLn ""
putStrLn $ "Launching web browser on " ++ url
unlessM (a url) $
error $ "failed to start web browser"
runCustomBrowser c u = boolSystem c [Param u]
{- web.browser is a generic git config setting for a web browser program -}