Skip to content

Commit edde4d2

Browse files
OJFordZordrak
authored andcommitted
Fix use of -chdir with an absolute path
Fixes tfutils#354.
1 parent 5110017 commit edde4d2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/tfenv-exec.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ set -uo pipefail;
55
function tfenv-exec() {
66
for _arg in ${@:1}; do
77
if [[ "${_arg}" == -chdir=* ]]; then
8-
log 'debug' "Found -chdir arg. Setting TFENV_DIR to: ${_arg#-chdir=}";
9-
export TFENV_DIR="${PWD}/${_arg#-chdir=}";
8+
chdir="${_arg#-chdir=}";
9+
log 'debug' "Found -chdir arg: ${chdir}";
10+
export TFENV_DIR="${PWD}/$(realpath --relative-to="${PWD}" "$chdir")";
11+
log 'debug' "Setting TFENV_DIR to: ${TFENV_DIR}";
1012
fi;
1113
done;
1214

0 commit comments

Comments
 (0)