-
Notifications
You must be signed in to change notification settings - Fork 48
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
Args not passed to other process #8
Comments
Does |
I had a similar problem and it was fixed by adding --. Thanks for the tip, @entropitor |
So how do you run It just hangs without doing anything... |
I'm guessing Basically any command line flag you want to parse to a the subprocess you're creating should be behind the |
Maybe we can refactor by use commander It is simple to write a command tool. Then We can use dotenv -e .env1 .env2 .env3 command <My command with args> |
@xyy94813 What's the advantage? You can already do this, as describe in this issue and by the README: https://github.com/entropitor/dotenv-cli#flags-to-the-underlying-command You just need to add dotenv -e .env1 .env2 .env3 -- command <My command with args> |
What's the advantage? But refactor by When i use Throw a Error: It took me a long time to find out the cause of the problem. Line 27 in 0bef67a
Because In addition, I hope that my use of the scene can bring a little inspiration The following is my usage scenario: Normally, i just need the default {
"scripts": {
"dev": "dotenv next dev"
},
} it is work well too {
"scripts": {
"dev": "dotenv -- next dev"
},
} But, some time i need to debug in diff deploy environment. I choice the first config, so that i can do something like this:
Woo~, everything in my control The command if i use the arg
Because yarn will ignore the first
|
It is a bit counterintuitive |
The -- is very common see e.g. https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean-also-known-as-bare-double-dash And your use-case is exactly an example of one why we want such a thing. Without it, the Feel free to fork the repo and publish your own version btw, but I believe it's better if we do use the |
I have a similar problem and tried with "--" but it still doesn't work. I have the following script in my package.json
When I run How should I write my command? @entropitor |
dotenv -e .env.test -- bash -c "docker compose up -d && yarn prisma migrate deploy && jest -i" If it doesn't, I don't know by hard. This is basic shell priority, this CLI doesn't do anything special |
For example:
dotenv mvn exec:java -Dexec.args="-g -f"
does not pass those-g -f
args into the Java method, whilstmvn exec:java -Dexec.args="-g -f"
works in this case.The text was updated successfully, but these errors were encountered: