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

Setting variable does not work when value has dash #65

Closed
rpmansion opened this issue Feb 7, 2022 · 11 comments
Closed

Setting variable does not work when value has dash #65

rpmansion opened this issue Feb 7, 2022 · 11 comments

Comments

@rpmansion
Copy link

For instance, setting dotenv -v AWS_REGION=eu-west-1 gives you an error of Unexpected argument AWS_REGION=eu-west-1. Expected variable in format variable=value

@hendriku
Copy link

Suffering from the same issue :( any workarounds or fixes?

@hendriku
Copy link

Using dotenv-cli v3.2.0 seems to fix this issue.

@hendriku
Copy link

Another workaround is intercepting the dotenv cli command with cross-env to manually pass additional command line arguments
e.g.

dotenv -- cross-env NODE_OPTIONS='--inspect' next dev

@entropitor
Copy link
Owner

We can improve this regex https://github.com/entropitor/dotenv-cli/blob/master/cli.js#L50

This is because of this security issue: #57 (comment)

Feel free to create a PR to fix this

@MorisR
Copy link

MorisR commented Mar 17, 2022

I think the same bug applies here ( or it might be a different bug 🤔🤔🤔)

Input:

image

Output:

image

@entropitor
Copy link
Owner

entropitor commented Mar 17, 2022 via email

@MorisR
Copy link

MorisR commented Mar 17, 2022

yeah but } shouldn't be part of the default value :/

image
that's from https://www.npmjs.com/package/dotenv-expand

@MorisR
Copy link

MorisR commented Mar 17, 2022

p.s. not sure if it's a bug for this package or dotenv-expand

@entropitor
Copy link
Owner

That's probably in dotenv-expand. This package is just a simple wrapper around that one...

@MorisR
Copy link

MorisR commented Mar 20, 2022

motdotla/dotenv-expand#70
yeah... it's a bug there, thanks.

@AndrewAllison
Copy link

Had a crack at a PR #69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants