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

Parameter Expansion support #341

Open hpohlmeyer opened 2 years ago

hpohlmeyer commented 2 years ago

Hi, I am trying to use env-cmd with parameter expansion to concatenate the variable with a string. Am I doing something wrong or is that currently impossible?


Here is an example:

.env:

VAR=World

package.json:

"echo": "env-cmd -x echo \"Hello ${VAR}!\""

Expected Output: Hello World!

Actual Output: Hello !

motdotla commented 6 months ago

alternatively you can use dotenvx for this. uses dotenv-expand under the hood.