feat: add module_print to module.lib will print the source of requested module
parent
a31e294a87
commit
51f73ccc02
12
module.lib
12
module.lib
|
@ -76,11 +76,21 @@ local FILE
|
|||
FILE=$(module_find $1)
|
||||
[ $? -ne 0 ] && echo no module $1 found && return 1
|
||||
# source $FILE "$0"
|
||||
[[ $BASHPID -eq $$ ]] || echo $FILE
|
||||
# [[ $BASHPID -eq $$ ]] || echo $FILE
|
||||
source $FILE
|
||||
return 0
|
||||
}
|
||||
|
||||
module_print() {
|
||||
[ ! $1 ] && echo "no module specified" && return 1
|
||||
# (return 0 2>/dev/null) && echo "module_load was sourced" || echo "module_log was executed"
|
||||
local FILE
|
||||
FILE=$(module_find $1)
|
||||
[ $? -ne 0 ] && echo no module $1 found && return 1
|
||||
cat $FILE
|
||||
return 0
|
||||
}
|
||||
|
||||
module_loaded() {
|
||||
[ ! $1 ] && echo "no module specified" && return 1
|
||||
local func
|
||||
|
|
Loading…
Reference in New Issue