few improvements, consistency fixes
This commit is contained in:
@@ -79,13 +79,16 @@ show_version()
|
||||
|
||||
local mod=
|
||||
for mod in $MYPATH/modules/*.sh; do
|
||||
. $mod
|
||||
local modname=$(get_mod_name $mod)
|
||||
local version=VER_$modname
|
||||
# Ran in a subshell to not pollute environment
|
||||
(
|
||||
. $mod
|
||||
local modname=$(get_mod_name $mod)
|
||||
local version=VER_$modname
|
||||
|
||||
echo -e "\t$BWhite$modname${DEFAULTCOL}: $BGreen${!version}$DEFAULTCOL"
|
||||
echo -e "\t$BWhite$modname${DEFAULTCOL}: $BGreen${!version}$DEFAULTCOL"
|
||||
|
||||
unset modname version
|
||||
unset modname version
|
||||
)
|
||||
done
|
||||
unset mod
|
||||
|
||||
@@ -100,6 +103,10 @@ export -f show_version
|
||||
# Get module name from module file
|
||||
get_mod_name()
|
||||
{
|
||||
if [[ $# -ne 1 ]] then
|
||||
prnt E "get_mod_name(): Bad number of parameters."
|
||||
die 11 --force
|
||||
fi
|
||||
echo $(basename $1 | cut -f 1 -d '.')
|
||||
}
|
||||
export -f get_mod_name
|
||||
|
||||
Reference in New Issue
Block a user