Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read issues when value has '$' character #84

Closed
Arattian opened this issue Jan 28, 2021 · 2 comments
Closed

Read issues when value has '$' character #84

Arattian opened this issue Jan 28, 2021 · 2 comments
Labels
awaiting response Contributors are awaiting a response. question

Comments

@Arattian
Copy link

The workaround mentioned here #81 is not working for me.
For the input value of
TEST="8k73fe1CDu4a%3v7FJR%&o61KHf@w!!3t8NJTdT%jn\$iSRIP^9J6pzf3P4Ulfjaw"
The output is
process.env.TEST="8k73fe1CDu4a%3v7FJR%&o61KHf@w!!3t8NJTdT%jn^9J6pzf3P4Ulfjaw"

It still replaces the $iSRIP part with an empty string.

I have tried with single/double/without quotes.

Package version 3.1.0

Originally posted by @Arattian in #81 (comment)

@neverendingqs
Copy link
Owner

Unfortunately, I am unable to reproduce what you are seeing. This is the setup I have:

.env:

TEST_0=8k73fe1CDu4a%3v7FJR%&o61KHf@w!!3t8NJTdT%jn\$iSRIP^9J6pzf3P4Ulfjaw
TEST_1="8k73fe1CDu4a%3v7FJR%&o61KHf@w!!3t8NJTdT%jn\$iSRIP^9J6pzf3P4Ulfjaw"

config.js:

module.exports = serverless => {
  serverless.cli.consoleLog({
    TEST_0: process.env.TEST_0,
    TEST_1: process.env.TEST_1
  });

  return {};
};

serverless.yml:

...
plugins:
  - serverless-dotenv-plugin

custom:
  configFile: ${file(./config.js)}
...

Output after running sls package:

Serverless: DOTENV: Loading environment variables from .env:
Serverless:      - TEST_0
Serverless:      - TEST_1
{
  TEST_0: '8k73fe1CDu4a%3v7FJR%&o61KHf@w!!3t8NJTdT%jn$iSRIP^9J6pzf3P4Ulfjaw',
  TEST_1: '8k73fe1CDu4a%3v7FJR%&o61KHf@w!!3t8NJTdT%jn$iSRIP^9J6pzf3P4Ulfjaw'
}
...

I am at serverless-dotenv-plugin@3.1.0 (latest).

Can you provide a minimal, reproducible example that demonstrates what you are seeing?

@neverendingqs
Copy link
Owner

FYI serverless-dotenv-plugin@3.3.0 introduced #116, which allows you to turn off this behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response Contributors are awaiting a response. question
Projects
None yet
Development

No branches or pull requests

2 participants