mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-27 01:53:08 +02:00
modulecmd: bugfix in use/unuse overlay
- Since Pmodules itself can be loaded as module, it must be possible to add/remove overlays if no modules are loaded or only a Pmodules module.
This commit is contained in:
@@ -1323,7 +1323,7 @@ subcommand_use() {
|
||||
|
||||
use () {
|
||||
use_overlay() {
|
||||
if [[ -n "${_LMFILES_}" ]]; then
|
||||
if [[ -n "${_LMFILES_}" ]] && [[ ${LOADEDMODULES} != Pmodules/* ]]; then
|
||||
std::die 3 "%s %s: %s -- %s" \
|
||||
"${CMD}" "${subcommand}" \
|
||||
"overlays can be added as long as no modules are loaded!" \
|
||||
@@ -1529,12 +1529,11 @@ subcommand_unuse() {
|
||||
|
||||
unuse() {
|
||||
unuse_overlay() {
|
||||
[[ -n "${_LMFILES_}" ]] && \
|
||||
std::die 3 "%s %s: %s -- %s" \
|
||||
if [[ -n "${_LMFILES_}" ]] && [[ ${LOADEDMODULES} != Pmodules/* ]]; then std::die 3 "%s %s: %s -- %s" \
|
||||
"${CMD}" "${subcommand}" \
|
||||
"overlays can be removed as long as modules are loaded!" \
|
||||
"overlays can NOT be removed as long as modules are loaded!" \
|
||||
"${overlay}"
|
||||
|
||||
fi
|
||||
overlay=${overlay%:*} # ignore any modifier
|
||||
overlay=${overlay%/} # remove trailing '/' if there is one
|
||||
[[ -d "${overlay}" ]] || \
|
||||
|
||||
Reference in New Issue
Block a user