rascal 1.1.4 → 1.1.5
raw patch · 2 files changed
+15/−6 lines, 2 files
Files
- rascal.cabal +6/−4
- src/Rascal/Utils.hs +9/−2
rascal.cabal view
@@ -1,12 +1,9 @@ name: rascal --- The package version. See the Haskell package versioning policy (PVP) --- for standards guiding when and how versions should be incremented.--- http://www.haskell.org/haskellwiki/Package_versioning_policy -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 1.1.4+version: 1.1.5 synopsis: A command-line client for Reddit description: Rascal is a command-line client for Reddit with colors, configurable sorting, threaded comments, and some day@@ -21,6 +18,11 @@ cabal-version: >=1.10 stability: experimental homepage: http://soli.github.io/rascal/++source-repository this+ type: git+ location: git://github.com/soli/rascal.git+ tag: v1.1.5 source-repository head type: git
src/Rascal/Utils.hs view
@@ -4,7 +4,9 @@ import System.Info (os) import Control.Exception (handle) import Data.List (elemIndices)+import System.Environment (getEnv) +import System.Directory (findExecutable) import System.Process (callProcess) import System.Console.ANSI (clearLine) @@ -100,8 +102,13 @@ message ("opening '" ++ u ++ "'…") w handle (\e -> print (e :: IOError)) $ case os of- "darwin" -> callProcess "open" ["-g", u] -- open in the background- "linux" -> callProcess "xdg-open" [u, "&"] -- getEnv BROWSER ???+ "darwin" -> callProcess "open" ["-g", u] -- open in the background+ "linux" -> do+ hasXdg <- findExecutable "xdg-open"+ cmd <- case hasXdg of+ Nothing -> getEnv "BROWSER"+ Just path -> return path+ callProcess cmd [u] "mingw32" -> callProcess "start" ["", u] _ -> return ()