Skip to content

Commit

Permalink
Fix use of -chdir with an absolute path
Browse files Browse the repository at this point in the history
Fixes #354.
  • Loading branch information
OJFord committed Feb 10, 2024
1 parent 934a002 commit b5782f8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/tfenv-exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ set -uo pipefail;
function tfenv-exec() {
for _arg in ${@:1}; do
if [[ "${_arg}" == -chdir=* ]]; then
log 'debug' "Found -chdir arg. Setting TFENV_DIR to: ${_arg#-chdir=}";
export TFENV_DIR="${PWD}/${_arg#-chdir=}";
chdir="${_arg#-chdir=}";
log 'debug' "Found -chdir arg: ${chdir}";
export TFENV_DIR="${PWD}/$(realpath --relative-to="${PWD}" "$chdir")";
log 'debug' "Setting TFENV_DIR to: ${TFENV_DIR}";
fi;
done;

Expand Down

0 comments on commit b5782f8

Please sign in to comment.