-
Notifications
You must be signed in to change notification settings - Fork 13
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
Expand existing variables #29
Comments
@jpvillaisaza I think that this is a good initiative. Thanks for opening this issue. We should think about how other libraries implement this sort of feature, and think critically about the best way to proceed. I noticed that:
I agree with the general idea of adding functionality to the dotenv templates. However, we may just want to proceed slowly, and based on standards wherever possible so that we don't introduce something that we regret later. We may also want to separate the notion of path expansion from full POSIX-compliant variable expansion and consider those two separately. What do you think? |
@jsl Yes, sounds good. I saw the issue for the Python one before opening this issue. I don't have experience with this library (use or development), so I can start taking a look and we can add notes here to think of the best way. |
I ran a test using the
START='this is a test' # test with spaces
REFERENCE_TO_START=$START
UNQUOTED_REFERENCE=$HOME
UNQUOTED_REFERENCE_WITH_EXTRA=$HOME_abc
UNQUOTED_REFERENCE_WITH_BRACES=${HOME}
UNQUOTED_REFERENCE_WITH_BRACES_AND_EXTRA=${HOME}_abc
SINGLE_QUOTED_REFERENCE='$HOME'
SINGLE_QUOTED_REFERENCE_WITH_EXTRA='$HOME_abc'
SINGLE_QUOTED_REFERENCE_WITH_BRACES='${HOME}'
SINGLE_QUOTED_REFERENCE_WITH_BRACES_AND_EXTRA='${HOME}_abc'
DOUBLE_QUOTED_REFERENCE="$HOME"
DOUBLE_QUOTED_REFERENCE_WITH_EXTRA="$HOME_abc"
DOUBLE_QUOTED_REFERENCE_WITH_BRACES="${HOME}"
DOUBLE_QUOTED_REFERENCE_WITH_BRACES_AND_EXTRA="${HOME}_abc"
UNQUOTED_SHELL_INTERPOLATION_WITH_PARENS=$(whoami)
UNQUOTED_SHELL_INTERPOLATION_WITH_BACKTICKS=`whoami`
UNQUOTED_SHELL_INTERPOLATION_WITH_PARENS_AND_EXTRA=$(whoami)_abc
UNQUOTED_SHELL_INTERPOLATION_WITH_BACKTICKS_AND_EXTRA=`whoami`_abc
SINGLE_QUOTED_SHELL_INTERPOLATION_WITH_PARENS='$(whoami)'
SINGLE_QUOTED_SHELL_INTERPOLATION_WITH_BACKTICKS='`whoami`'
SINGLE_QUOTED_SHELL_INTERPOLATION_WITH_PARENS_AND_EXTRA='$(whoami)_abc'
SINGLE_QUOTED_SHELL_INTERPOLATION_WITH_BACKTICKS_AND_EXTRA='`whoami`_abc'
DOUBLE_QUOTED_SHELL_INTERPOLATION_WITH_PARENS="$(whoami)"
DOUBLE_QUOTED_SHELL_INTERPOLATION_WITH_BACKTICKS="`whoami`"
DOUBLE_QUOTED_SHELL_INTERPOLATION_WITH_PARENS_AND_EXTRA="$(whoami)_abc"
DOUBLE_QUOTED_SHELL_INTERPOLATION_WITH_BACKTICKS_AND_EXTRA="`whoami`_abc" Output of each variable (
|
I think we can close this issue, because of #42 |
I would like to use a .env file like the following:
After loading the file,
FOO
should be/home/jpvi/.foo
or something like that.@jsl Let me know if this makes sense and I can take a look.
The text was updated successfully, but these errors were encountered: