We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 82fe3ce + d0d6f12 commit 459d15bCopy full SHA for 459d15b
1 file changed
libexec/tfenv-install
@@ -134,10 +134,9 @@ shasums_sig="${shasums_name}${shasums_signing_key_postfix}.sig";
134
log 'info' "Installing Terraform v${version}";
135
136
# Create a local temporary directory for downloads
137
-tmpdir_arg="--tmpdir"
138
-if [[ $(uname) == 'Darwin' ]]; then
139
- # MacOS uses an old version of `mktemp` which only supports the deprecated `-t` option
140
- tmpdir_arg="-t"
+tmpdir_arg="-t"
+if mktemp --help 2>&1 | grep -- '--tmpdir' >/dev/null; then
+ tmpdir_arg="--tmpdir"
141
fi
142
download_tmp="$(mktemp -d ${tmpdir_arg} tfenv_download.XXXXXX)" || log 'error' "Unable to create temporary download directory in $(pwd)";
143
# Clean it up in case of error
0 commit comments