Skip to content

Commit

Permalink
Merge pull request tfutils#285 from jxinging/master
Browse files Browse the repository at this point in the history
Fix: mktemp not working correctly on Alpine Linux tfutils#284
  • Loading branch information
Zordrak authored Aug 16, 2021
2 parents 82fe3ce + d0d6f12 commit 459d15b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libexec/tfenv-install
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,9 @@ shasums_sig="${shasums_name}${shasums_signing_key_postfix}.sig";
log 'info' "Installing Terraform v${version}";

# Create a local temporary directory for downloads
tmpdir_arg="--tmpdir"
if [[ $(uname) == 'Darwin' ]]; then
# MacOS uses an old version of `mktemp` which only supports the deprecated `-t` option
tmpdir_arg="-t"
tmpdir_arg="-t"
if mktemp --help 2>&1 | grep -- '--tmpdir' >/dev/null; then
tmpdir_arg="--tmpdir"
fi
download_tmp="$(mktemp -d ${tmpdir_arg} tfenv_download.XXXXXX)" || log 'error' "Unable to create temporary download directory in $(pwd)";
# Clean it up in case of error
Expand Down

0 comments on commit 459d15b

Please sign in to comment.