toddbluhm / env-cmd

Setting environment variables from a file
https://www.npmjs.com/package/env-cmd
MIT License
1.73k stars 65 forks source link

`environments` and `file` options may be mutually exclusive #372

Open abacaphiliac opened 7 months ago

abacaphiliac commented 7 months ago

Great tool, use it every day, thank you!

I got tripped up today by using -e with -f. The tool throws a generic error about a missing .rc file:

Error: Failed to find .rc file at default paths: [./.env-cmdrc,./.env-cmdrc.js,./.env-cmdrc.json]

Turns out that you need to use -e with -r, something that I do know and have used many times in the past but forgot for some reason today.

Is it true to say that -e can only be used with -r? Is it true to say that you'd never use -f with -r? If so, i'm thinking we might be able to provide a more helpful error message to let folks know their options are invalid in a very specific way.

Thanks for the consideration! Happy to help if this sounds useful.