packages feed

rio 0.1.21.0 → 0.1.22.0

raw patch · 4 files changed

+28/−8 lines, 4 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ RIO.Process: augmentPathMap' :: Text -> [FilePath] -> EnvVars -> Either ProcessException EnvVars
- RIO.Prelude.Types: -- | State token type
+ RIO.Prelude.Types: -- | State token type.
- RIO.Prelude.Types: class Hashable a
+ RIO.Prelude.Types: class Eq a => Hashable a

Files

ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for rio +## 0.1.22.0++* Expose `augmentPathMap'`+ ## 0.1.21.0  * Fix minor bug in `augmentPathMap` on windows wrt [#234](https://github.com/commercialhaskell/rio/issues/234) not adhering to case-insensitive semantics
rio.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           rio-version:        0.1.21.0+version:        0.1.22.0 synopsis:       A standard library for Haskell description:    See README and Haddocks at <https://www.stackage.org/package/rio> category:       Control
src/RIO/Prelude/Logger.hs view
@@ -544,7 +544,7 @@ setLogVerboseFormatIO getVerboseLevel options =   options { logVerboseFormat = getVerboseLevel } --- | Do we treat output as a terminal. If @True@, we will enabled+-- | Do we treat output as a terminal. If @True@, we will enable -- sticky logging functionality. -- -- Default: checks if the @Handle@ provided to 'logOptionsHandle' is a
src/RIO/Process.hs view
@@ -77,6 +77,7 @@   , exeExtensions   , augmentPath   , augmentPathMap+  , augmentPathMap'   , showProcessArgDebug     -- * Reexports   , P.ProcessConfig@@ -659,8 +660,9 @@   pc <- view processContextL   return $ pcExeExtensions pc --- | Augment the PATH environment variable with the given extra paths,--- which are prepended (as in: they take precedence).+-- | Augment the given value (assumed to be that of an environment variable+-- that lists paths, such as PATH; this is not checked) with the given extra+-- paths. Those paths are prepended (as in: they take precedence). -- -- @since 0.0.3.0 augmentPath :: [FilePath] -> Maybe Text -> Either ProcessException Text@@ -672,15 +674,29 @@             ++ maybeToList mpath     illegal -> Left $ PathsInvalidInPath illegal --- | Apply 'augmentPath' on the PATH value in the given 'EnvVars'.+-- | Apply 'augmentPath' on the value of the PATH environment variable in the+-- given 'EnvVars'. -- -- @since 0.0.3.0 augmentPathMap :: [FilePath] -> EnvVars -> Either ProcessException EnvVars-augmentPathMap dirs (normalizePathEnv -> origEnv) =+augmentPathMap = augmentPathMap' "PATH"++-- | Apply 'augmentPath' on the value of the given environment variable in the+-- given 'EnvVars'.+--+-- @since 0.1.22.0+augmentPathMap'+  :: Text+  -- ^ Environment variable. If it does not already exist in the given+  -- 'EnvVars', it will be created.+  -> [FilePath]+  -> EnvVars+  -> Either ProcessException EnvVars+augmentPathMap' envVar dirs (normalizePathEnv -> origEnv) =   do path <- augmentPath dirs mpath-     return $ Map.insert "PATH" path origEnv+     return $ Map.insert envVar path origEnv   where-    mpath = Map.lookup "PATH" origEnv+    mpath = Map.lookup envVar origEnv  -- | Show a process arg including speechmarks when necessary. Just for -- debugging purposes, not functionally important.