modulecmd: unset 'Version' before restoring variables from cache

If 'Version' is set in the calling shell, initialisation might be
skipped.
This commit is contained in:
2022-08-03 16:41:15 +02:00
parent 50ef08ca2f
commit ffbf6158e6
+2
View File
@@ -2882,6 +2882,8 @@ if [[ -z "${Subcommands[${subcommand}]}" ]]; then
std::die 1 "${CMD}: unknown sub-command -- ${subcommand}"
fi
# restore variables from last call
unset Version
if [[ -n ${PMODULES_ENV} ]]; then
eval "$("${base64}" -d <<< "${PMODULES_ENV}" 2>/dev/null)"
fi