HSH 2.1.1 → 2.1.2
raw patch · 3 files changed
+14/−8 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- HSH.cabal +2/−2
- HSH/Command.hs +2/−2
- HSH/ShellEquivs.hs +10/−4
HSH.cabal view
@@ -1,10 +1,10 @@ Name: HSH-Version: 2.1.1+Version: 2.1.2 License: LGPL Maintainer: John Goerzen <jgoerzen@complete.org> Author: John Goerzen Stability: Beta-Copyright: Copyright (c) 2006-2009 John Goerzen+Copyright: Copyright (c) 2006-2014 John Goerzen Category: system license-file: COPYRIGHT extra-source-files: COPYING
HSH/Command.hs view
@@ -39,7 +39,7 @@ import System.IO import System.Exit import System.Log.Logger-import System.IO.Error hiding (catch)+import System.IO.Error (isUserError, ioeGetErrorString) import Data.Maybe.Utils import Data.Maybe import Data.List.Utils(uniq)@@ -500,7 +500,7 @@ {- | Handle an exception derived from a program exiting abnormally -} tryEC :: IO a -> IO (Either ExitCode a) tryEC action =- do r <- try action+ do r <- Control.Exception.try action case r of Left ioe -> if isUserError ioe then
HSH/ShellEquivs.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE ScopedTypeVariables #-} {- Shell Equivalents Copyright (C) 2004-2009 John Goerzen <jgoerzen@complete.org> Please see the COPYRIGHT file@@ -86,7 +87,7 @@ import Text.Printf (printf) import Control.Monad (foldM) import System.Directory hiding (createDirectory)-import Control.Exception(evaluate, catch, try, SomeException(..))+import qualified Control.Exception as E -- import System.FilePath (splitPath) #ifdef __HSH_POSIX__@@ -111,7 +112,12 @@ import HSH.Command(setenv, unsetenv) {- | Return the absolute path of the arg. Raises an error if the-computation is impossible. -}+computation is impossible. This is a thin wrapper around+System.Path.absNormPath. Unix/Linux users note:+System.Path.absNormPath is known to produce odd results when+a tilde expansion is requested; you might prefer 'glob' to this+function if you know your input is free of wildcards. See+https://github.com/jgoerzen/hsh/issues/7 for details. -} abspath :: FilePath -> IO FilePath abspath inp = do p <- pwd@@ -252,7 +258,7 @@ discard :: Channel -> IO Channel discard inh = do c <- chanAsBSL inh- evaluate (BSL.length c)+ E.evaluate (BSL.length c) return (ChanString "") {- | Split a list by a given character and select ranges of the resultant lists.@@ -316,7 +322,7 @@ Non-tilde expansion is done by the MissingH module System.Path.Glob. -} glob :: FilePath -> IO [FilePath] glob inp@('~':remainder) =- catch expanduser (\(e::SomeException) -> Glob.glob rest)+ E.catch expanduser (\(e::E.SomeException) -> Glob.glob rest) where (username, rest) = span (/= '/') remainder #ifdef __HSH_POSIX__ expanduser =