Skip to content

Commit

Permalink
Fix use of -chdir with an absolute path
Browse files Browse the repository at this point in the history
  • Loading branch information
OJFord authored and Zordrak committed Oct 1, 2022
1 parent 5110017 commit edde4d2
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 edde4d2

Please sign in to comment.