Add option to skip shell escaping
This pull request adds a flag --raw to skip shell escaping the values that are being output. The use-case I have for this flag is two-fold:
-
The current escaping is quite aggressive and adds quotes in scenarios where they're not strictly necessary (e.g.
export FOO=bar+bazworks fine but currently gets escaped); adding this flag means more predictable output in scenarios where the user knows that the secrets won't contain any shell-specific special characters. -
More importantly adding this flag means that ejson2env can now be used on Github Actions to set environment variables (docs) via
ejson2env --raw path/to/secrets.ejson >> "${GITHUB_ENV}". Before this PR, this approach wouldn't work as Github Actions doesn't interpret escape characters.