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
source_env: show full path #870
Conversation
We have already stumbled across this several times. If you have an ".envrc.local" in both directories, you get the same logging twice, which often leads to the assumption that the same file is sourced twice.
|
stdlib.sh
Outdated
@@ -346,7 +346,7 @@ source_env() { | |||
pushd "$(pwd 2>/dev/null)" >/dev/null || return 1 | |||
pushd "$rcpath_dir" >/dev/null || return 1 | |||
if [[ -f ./$rcpath_base ]]; then | |||
log_status "loading $rcfile" | |||
log_status "loading $(expand_path "$rcpath")" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the expand_path
be amended to show ~
instead of user home path?
Kind of:
log_status "loading $(expand_path "$rcpath")" | |
log_status "loading $(expand_path "$rcpath" | sed 's|^'${HOME:=none}'|~|')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yermulnik thanks for catching the regression! user_rel_path
did it eventually.
Before: Given ~/path/to/.envrc containing: source_env .envrc.local When doing `direnv exec ~/path/to true` it shows: direnv: loading .envrc.local After: It shows: direnv: loading ~/path/to/.envrc.local
@zimbatm thoughts on this one? 🙏🏻 |
thanks! |
Paths passed to
source_env(_if_exists)
are logged as-is, e.g..envrc.local
.This PR ensures the full path is logged, like with
source_up
.