isaacs/nave

How would I use environment variables from the parent shell?

rjmccluskey opened this issue · 1 comments

Say I have an environment variable in the parent shell called MY_VAR. I'd like to use nave to run a program and immediately exit, but it won't recognize my variable.

For example:

nave use 12 echo "$MY_VAR"

This doesn't work as I hoped for because the subshell doesn't know about that variable set in the parent shell. Is there a way to let the subshell know about parent variables or to pass an argument to the program when running nave use <ver> <program>?

Sorry, I got ahead of myself. Turns out my problem is that I'm running the script as an npm script.