mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-27 10:03:08 +02:00
modulecmd: bugfix in tmp file setup/cleanup
This commit is contained in:
@@ -1465,7 +1465,6 @@ subcommand_purge() {
|
||||
local output=$("${modulecmd}" 'bash' 'purge' 2> "${tmpfile}")
|
||||
|
||||
local error=$( < "${tmpfile}")
|
||||
${rm} "${tmpfile}"
|
||||
if [[ "${error}" =~ ":ERROR:" ]]; then
|
||||
local s=${error%%$'\n'*}
|
||||
local error_txt='failed'
|
||||
@@ -1755,8 +1754,6 @@ subcommand_search() {
|
||||
func_print_line='print_line_csv'
|
||||
}
|
||||
|
||||
local -r tmpfile=$1
|
||||
|
||||
if [[ "${opt_print_modulefiles}" == 'yes' ]]; then
|
||||
print_modulefiles
|
||||
elif [[ "${opt_print_csv}" == 'yes' ]]; then
|
||||
@@ -1852,7 +1849,6 @@ subcommand_search() {
|
||||
done
|
||||
done
|
||||
print_result "${tmpfile}"
|
||||
${rm} -f "${tmpfile}"
|
||||
}
|
||||
|
||||
while (( $# > 0 )); do
|
||||
@@ -2277,6 +2273,9 @@ case ${subcommand} in
|
||||
declare -r tmpfile=$( ${mktemp} /tmp/Pmodules.XXXXXX ) \
|
||||
|| std::die 1 "Oops: unable to create tmp file!"
|
||||
;;
|
||||
* )
|
||||
declare -r tmpfile=''
|
||||
;;
|
||||
esac
|
||||
|
||||
declare options
|
||||
|
||||
Reference in New Issue
Block a user