on master help sign in
Linux support
commite395aad69a9e8a1188e8188ae8c9cf74daab2c5d authorMichael Snoyman <michael@snoyman.com> dateTue 24 May 2011, 10:26 (15 years ago) parentdda3a76
2 files changed+7
Network/Wai/Handler/Launch.hs+5 wai-handler-launch.cabal+2
Network/Wai/Handler/Launch.hs+5
@@ -14,6 +14,9 @@ import Control.Monad.IO.Class (liftIO)
1414import qualified Data.ByteString as S
1515import Data.Enumerator (($$), enumList)
1616import Blaze.ByteString.Builder (fromByteString)
17+#if !WINDOWS
18+import System.Cmd (rawSystem)
19+#endif
1720
1821ping :: IORef Bool -> Middleware
1922ping var app req
@@ -35,6 +38,8 @@ ping var app req
3538foreign import ccall "launch"
3639 launch :: IO ()
3740#else
41+launch :: IO ()
42+launch = rawSystem "xdg-open" ["http://localhost:4587/"] >> return ()
3843#endif
3944
4045run :: Application -> IO ()
wai-handler-launch.cabal+2
@@ -24,3 +24,5 @@ Library
2424 c-sources: windows.c
2525 cpp-options: -DWINDOWS
2626 extra-libraries: Shell32
27+ else
28+ build-depends: process >= 1.0 && < 1.2