mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
fix: instead /tmp, use TMPDIR if defined
This commit is contained in:
parent
39909e01af
commit
91136234e9
@ -145,12 +145,15 @@ remove_obsolete_shims() {
|
||||
local formatted_shims
|
||||
local formatted_exec_names
|
||||
|
||||
local temp_dir
|
||||
temp_dir=${TMPDIR:-/tmp}
|
||||
|
||||
# comm only takes to files, so we write this data to temp files so we can
|
||||
# pass it to comm.
|
||||
formatted_shims=$(mktemp /tmp/asdf-command-reshim-formatted-shims.XXXXXX)
|
||||
formatted_shims="$(mktemp "$temp_dir/asdf-command-reshim-formatted-shims.XXXXXX")"
|
||||
printf "%s\\n" "$shims" >"$formatted_shims"
|
||||
|
||||
formatted_exec_names=$(mktemp /tmp/asdf-command-reshim-formatted-exec-names.XXXXXX)
|
||||
formatted_exec_names="$(mktemp "$temp_dir/asdf-command-reshim-formatted-exec-names.XXXXXX")"
|
||||
printf "%s\\n" "$exec_names" >"$formatted_exec_names"
|
||||
|
||||
obsolete_shims=$(comm -23 "$formatted_shims" "$formatted_exec_names")
|
||||
|
@ -74,9 +74,12 @@ list_all_command() {
|
||||
plugin_path=$(get_plugin_path "$plugin_name")
|
||||
check_if_plugin_exists "$plugin_name"
|
||||
|
||||
local temp_dir
|
||||
temp_dir=${TMPDIR:-/tmp}
|
||||
|
||||
# Capture return code to allow error handling
|
||||
std_out_file="$(mktemp "/tmp/asdf-command-list-all-${plugin_name}.stdout.XXXXXX")"
|
||||
std_err_file="$(mktemp "/tmp/asdf-command-list-all-${plugin_name}.stderr.XXXXXX")"
|
||||
std_out_file="$(mktemp "$temp_dir/asdf-command-list-all-${plugin_name}.stdout.XXXXXX")"
|
||||
std_err_file="$(mktemp "$temp_dir/asdf-command-list-all-${plugin_name}.stderr.XXXXXX")"
|
||||
return_code=0 && "${plugin_path}/bin/list-all" >"$std_out_file" 2>"$std_err_file" || return_code=$?
|
||||
|
||||
if [[ $return_code -ne 0 ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user