Giter VIP home page Giter VIP logo

Comments (3)

entropitor avatar entropitor commented on July 18, 2024

please read the readme before filing isues https://github.com/entropitor/dotenv-cli#flags-to-the-underlying-command

from dotenv-cli.

kswope avatar kswope commented on July 18, 2024

I saw that but I think I got confused because the example is backwards

This is what is there now:

E.g. the following command without dotenv-cli:
$ mvn exec:java -Dexec.args="-g -f"
will become the following command with dotenv-cli:
$ dotenv -- mvn exec:java -Dexec.args="-g -f"

It should be written:

$ dotenv -- mvn exec:java -Dexec.args="-g -f"
will become the command to dotenv-cli
$ mvn exec:java -Dexec.args="-g -f"

Also: this way of parsing command line arguments unfortunately doesn't work well with npm scripts, like dotenv and godotenv do.

in package.json
"test": "node -r dotenv/config node_modules/.bin/ava",
$ npm run test -- -wv
runs
node -r dotenv/config node_modules/.bin/ava "-wv"

in package.json
"testwithgodotenv": "godotenv ava",
npm run testwithgodotenv -- -wv
runs
godotenv ava "-wv"

in package.json
"testwithdotenv": "dotenv ava",
$ npm run testwithdotenv -- -wv
runs
dotenv ava "-wv" <--- the original error in the issue

from dotenv-cli.

entropitor avatar entropitor commented on July 18, 2024
  1. The readme says how to construct the dotenv command. I think this is what is most useful to people getting started. Feel free to create a PR to improve it but keep in mind that it should explain how to use it, not how it works
  2. Given it's such a common idiom to ignore everything after --, npm and others also use it so what you want is
npm run testwithdotenv -- -- -wv

Notice the double --, one to say, npm don't parse anything after these but pass them along and another to say to dotenv-cli do not parse anything after these...

So dotenv sees dotenv ava -- "-wv" and ava sees ava "-wv"

from dotenv-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.