packages feed

dotenv 0.3.1.0 → 0.3.2.0

raw patch · 4 files changed

+26/−9 lines, 4 filesnew-uploaderPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,8 @@+## Dotenv 0.3.2.0++* Add the option to pass arguments to the program passed to Dotenv. Thanks to+  Oleg Grenrus (GitHub: phadej) for making this contribution.+ ## Dotenv 0.3.1.0  * Made interface more polymorphic so the functions works in any instance of@@ -24,14 +29,14 @@ * Reverted change to Data.Text in favor of String, for maintaining compatibility   with common Haskell system libraries. Added separate interface for parsing a   file into tuples containing Data.Text values. Thanks to Daisuke Fujimura-  (Github: fujimura).+  (GitHub: fujimura). * Fixed parsing of CRLF characters for Windows users.  ## Dotenv 0.2.0.0 (deprecated)  * Changed public interfaces to use Data.Text. * Added function `parseFile` to read dotenv file without modifying the-  environment. Thanks to Daisuke Fujimura (Github: fujimura) for making this+  environment. Thanks to Daisuke Fujimura (GitHub: fujimura) for making this   contribution.  ## Dotenv 0.1.0.0
README.md view
@@ -69,10 +69,17 @@ dotenv -f mydotenvfile myprogram ``` +Aditionally you can pass arguments and flags to the program passed to+Dotenv:++```+dotenv -f mydotenvfile myprogram -- --myflag myargument+```+ Hint: The `env` program in most Unix-like environments prints out the current environment settings. By invoking the program `env` in place of `myprogram` above you can see what the environment will look like-after evaluating multiple  Dotenv files.+after evaluating multiple Dotenv files.  ## Author @@ -84,4 +91,4 @@  ## Copyright -(C) 2015-2016 [Stack Builders Inc.](http://www.stackbuilders.com)+(C) 2015-2017 [Stack Builders Inc.](http://www.stackbuilders.com)
app/Main.hs view
@@ -17,8 +17,9 @@  data Options = Options   { files    :: [String]-  , program  :: String   , overload :: Bool+  , program  :: String+  , args     :: [String]   } deriving (Show)  main :: IO ()@@ -37,14 +38,18 @@                   <> metavar "FILE"                   <> help "File to read for options" )) -     <*> argument str (metavar "PROGRAM")-      <*> switch ( long "overload"                   <> short 'o'                   <> help "Specify this flag to override existing variables" ) +     <*> argument str (metavar "PROGRAM")++     <*> many (argument str (metavar "ARG"))+ dotEnv :: MonadIO m => Options -> m () dotEnv opts = liftIO $ do   mapM_ (loadFile (overload opts)) (files opts)-  code <- system (program opts)+  code <- system (program opts ++ programArguments)   exitWith code+  where+   programArguments = concatMap (" " ++) (args opts)
dotenv.cabal view
@@ -1,5 +1,5 @@ name:                dotenv-version:             0.3.1.0+version:             0.3.2.0 synopsis:            Loads environment variables from dotenv files homepage:            https://github.com/stackbuilders/dotenv-hs description: