From 5a3e3ef175dac6dd645e69347e12040e46228b66 Mon Sep 17 00:00:00 2001 From: Cristhian Motoche Date: Wed, 21 Jun 2023 20:21:33 -0500 Subject: [PATCH] chore: Update README and bump version (#170) * Update README.md & bump version * bump: 0.11.0.2 --- CHANGELOG.md | 4 ++++ README.md | 21 +++++++++++++++++++++ dotenv.cabal | 4 ++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c72818..8dda8a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ ## MASTER +## Dotenv 0.11.0.2 +### Modified +* Allow optparse-applicative 0.18 + ## Dotenv 0.11.0.1 ### Modified * Export internal module `Configuration.Dotenv.Internal` which exports all diff --git a/README.md b/README.md index 7fd2814..806a457 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,27 @@ $ dotenv "echo $DATABASE" postgres://myusername@localhost/database ``` +### Surrond with quotes + +If your value starts with a character that produces a parse error (e.g. `{`) . Surround your value +with quotes. You can also escape the quotes if they're inside your value. For example: + +``` +JSON_SQ='{"a":[1,2,3], "b": "\'asdf\'"}' +JSON_DQ="{\"a\":[1,2,3], \"b\": \"'asdf'\"}" +``` + +Run it: + +``` +$ dotenv "echo $JSON_SQ" | jq .a +[ + 1, + 2, + 3 +] +``` + ### Configuration The first argument to `loadFile` specifies the configuration. You can use diff --git a/dotenv.cabal b/dotenv.cabal index 7bc183f..5729a91 100644 --- a/dotenv.cabal +++ b/dotenv.cabal @@ -1,5 +1,5 @@ name: dotenv -version: 0.11.0.1 +version: 0.11.0.2 synopsis: Loads environment variables from dotenv files homepage: https://github.com/stackbuilders/dotenv-hs description: @@ -65,7 +65,7 @@ executable dotenv build-depends: base >= 4.9 && < 5.0 , base-compat >= 0.4 , dotenv - , optparse-applicative >= 0.11 && < 0.18 + , optparse-applicative >= 0.11 && < 0.19 , megaparsec , process , text