summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-04-18 12:52:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-04-18 12:52:55 -0400
commit7fa1a12a2435e69d7f4838cd373aee4bfb2a66df (patch)
tree05b23b7bf1d6d82d55fcbb299c75c943f7c3f743 /Command
parent3fa062bb3e71fb7cabc0b6814d22bcbe7602f275 (diff)
untested browser opening on Android
I've found multiple references to using the `am` command from the adb shell to open a browser. So I assume it also works in a terminal emulator.
Diffstat (limited to 'Command')
-rw-r--r--Command/WebApp.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Command/WebApp.hs b/Command/WebApp.hs
index 2d01b0d15..90abd4d27 100644
--- a/Command/WebApp.hs
+++ b/Command/WebApp.hs
@@ -150,7 +150,7 @@ firstRun listenhost = do
sendurlback v _origout _origerr url _htmlshim = putMVar v url
openBrowser :: Maybe FilePath -> FilePath -> Maybe Handle -> Maybe Handle -> IO ()
-openBrowser cmd htmlshim outh errh = do
+openBrowser mcmd htmlshim outh errh = do
hPutStrLn (fromMaybe stdout outh) $ "Launching web browser on " ++ url
environ <- cleanEnvironment
(_, _, _, pid) <- createProcess p
@@ -163,7 +163,9 @@ openBrowser cmd htmlshim outh errh = do
hPutStrLn (fromMaybe stderr errh) "failed to start web browser"
where
url = fileUrl htmlshim
- p = proc (fromMaybe browserCommand cmd) [htmlshim]
+ p = case mcmd of
+ Just cmd -> proc cmd [htmlshim]
+ Nothing -> browserProc htmlshim
{- web.browser is a generic git config setting for a web browser program -}
webBrowser :: Git.Repo -> Maybe FilePath