Skip to content

Commit

Permalink
source_env: show full path
Browse files Browse the repository at this point in the history
  • Loading branch information
eval committed Apr 6, 2022
1 parent a446746 commit 64bb34c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib.sh
Expand Up @@ -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 $(user_rel_path "$(expand_path "$rcpath")")"
# shellcheck disable=SC1090
. "./$rcpath_base"
else
Expand Down
5 changes: 5 additions & 0 deletions test/stdlib.bash
Expand Up @@ -190,6 +190,11 @@ test_name source_env_if_exists
echo "export FOO=bar" > existing_file
source_env_if_exists existing_file
[[ $FOO = bar ]]

# Expect correct path being logged
export HOME=$workdir
output="$(source_env_if_exists existing_file 2>&1 > /dev/null)"
[[ "${output#*'loading ~/existing_file'}" != "$output" ]]
)

test_name env_vars_required
Expand Down

0 comments on commit 64bb34c

Please sign in to comment.