on master help sign in
Linux support
e395aadMichael Snoyman
Network/Wai/Handler/Launch.hs+5
@@ -14,6 +14,9 @@ import Control.Monad.IO.Class (liftIO)
14import qualified Data.ByteString as S
14import qualified Data.ByteString as S
15import Data.Enumerator (($$), enumList)
15import Data.Enumerator (($$), enumList)
16import Blaze.ByteString.Builder (fromByteString)
16import Blaze.ByteString.Builder (fromByteString)
17+#if !WINDOWS
18+import System.Cmd (rawSystem)
19+#endif
17
20
18ping :: IORef Bool -> Middleware
21ping :: IORef Bool -> Middleware
19ping var app req
22ping var app req
@@ -35,6 +38,8 @@ ping var app req
35foreign import ccall "launch"
38foreign import ccall "launch"
36 launch :: IO ()
39 launch :: IO ()
37#else
40#else
41+launch :: IO ()
42+launch = rawSystem "xdg-open" ["http://localhost:4587/"] >> return ()
38#endif
43#endif
39
44
40run :: Application -> IO ()
45run :: Application -> IO ()
wai-handler-launch.cabal+2
@@ -24,3 +24,5 @@ Library
24 c-sources: windows.c
24 c-sources: windows.c
25 cpp-options: -DWINDOWS
25 cpp-options: -DWINDOWS
26 extra-libraries: Shell32
26 extra-libraries: Shell32
27+ else
28+ build-depends: process >= 1.0 && < 1.2