this way of starting a browser seems more robust (#6)
This commit is contained in:
parent
44de5419a5
commit
d64d0b92d7
4
Utils.hs
4
Utils.hs
@ -19,7 +19,7 @@ import System.IO.UTF8 (hPutStrLn)
|
||||
import System.IO (hPutStrLn)
|
||||
#endif
|
||||
import System.Exit
|
||||
import System.Cmd (system)
|
||||
import System.Process (readProcessWithExitCode)
|
||||
import System.Info (os)
|
||||
import System.Time (ClockTime,getClockTime)
|
||||
|
||||
@ -74,7 +74,7 @@ openBrowserOn :: String -> IO ExitCode
|
||||
openBrowserOn u = trybrowsers browsers u
|
||||
where
|
||||
trybrowsers (b:bs) u = do
|
||||
e <- system $ printf "%s %s" b u
|
||||
(e,_,_) <- readProcessWithExitCode b [u] ""
|
||||
case e of
|
||||
ExitSuccess -> return ExitSuccess
|
||||
ExitFailure _ -> trybrowsers bs u
|
||||
|
||||
Loading…
Reference in New Issue
Block a user