modulecmd: bugfix in removing tmp file in _exit

This commit is contained in:
2021-08-12 18:27:01 +02:00
parent 979e4f5d38
commit e3d8ee9780
+3 -1
View File
@@ -143,7 +143,9 @@ save_env() {
_exit() {
save_env "${g_env_must_be_saved}"
${rm} -f "${tmpfile}"
if [[ -n "${tmpfile}" ]] && [[ -e "${tmpfile}" ]]; then
${rm} -f "${tmpfile}" || :
fi
}
trap '_exit' EXIT