Skip to content
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

Merged
merged 1 commit into from Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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