modulecmd: bugfix in sub-cmd 'unuse' if argument is a directory

This commit is contained in:
2024-05-02 15:50:52 +02:00
parent dd26a14f0d
commit 9e3b4c8237
+3 -2
View File
@@ -1864,7 +1864,7 @@ subcommand_unuse() {
if is_release_stage "${arg}"; then
# argument is release stage
std::remove_path UsedReleaseStages "${arg}"
return
return 0
fi
if [[ -v OverlayInfo[${arg}:type] ]]; then
unuse_overlay "${arg}"
@@ -1873,10 +1873,11 @@ subcommand_unuse() {
if [[ -d ${arg} ]]; then
local dir=$(std::get_abspath "${arg}")
std::remove_path MODULEPATH "${dir}"
return 0
fi
if [[ -n ${GroupDepths[${arg}]} ]]; then
unuse_group "${arg}"
return
return 0
fi
std::die 3 "%s %s: %s -- %s" \