Ok with just a text-code block it's not as 'impressive'...
So, here's an image:
Here's codeline 248-310 to illustrate that both 'output's are at the 'same location'.
Which is the absolute end of file of
./runtime
PHP Code:
#
# Starting SWARM now
#
source "$SWARMRC"
swarm.update.lang
swarm.update.lang.status
swarm.init.theme
#
# Initiate Interface
#
if [[ "./runtime" = "${0##/}" ]] || [[ "runtime" = "${0##/}" ]]
then # First time caller or arguments
if [[ -z "$1" ]]
then # First Time // No arguments
header --default
title "$SWARM_MSG_WELCOME_TITLE"
printe "$SWARM_MSG_WELCOME_INFOLINE1"
printe "$SWARM_MSG_WELCOME_INFOLINE2"
title "" # Separator
$ECHO "$SWARM_MSG_WELCOME_CONTENT" | printe -2 -- # "TODO: Visuals, then explain, configure and stuff..."
#status $? "one"
#init.countdown "Weee"
else # Has arguments, lets parse
case "$1" in
"basic")
shift
swarm.eu.show.basics
;;
"config")
shift
swarm.eu.show.config
;;
"help")
#echo hallo
shift
# Lets show a basic menu
swarm.eu.help.menu "${@}"
#break 2
;;
"tarball")
(
cd "${SWARM_DIR_ROOT}/.."
tar -acf "$HOME/swarm-${SWARM[BUILD]}.tar.gz" "${SWARM_DIR_ROOT##*/}"
)
;;
*) # Exit the loop
break
;;
esac
fi
fi
#
# Develeoper testings
#
if [[ "bash" = "${0/-}" ]]; then
#$ECHO " ----------- TEST AREA START -----------"
printe "Now it will work"
#set -x
# pick -m one two three four five six
#set +x
#$ECHO " ----------- TEST AREA END -----------"
fi"
Go figure, to me its 100% unclear.
EDIT:
As you (dont) see, all functions were loaded before the code segment above.
This is the source of my confusion, because both if-blocks come after all functions and variable definitions, regardless, when executed directly, the 'theme' seems not to work....
Unless it was also previously sourced, but it cant source itself, because this ends in an endless loop.
--> And that is exactly what I had thought to have just solved. <--
On the good side, I can keep trying to get
pick working as intended, allthough I'll need to source the runtime first, once.
Writing this, brought up the idea of yet another 'improper' variable handling..
Maybe I'll need to check a variable check.
Question is, which one?
Theme's... again... seems kinda like it...
Maybe that parts needs a different handling wether it is sourced or executed?
It also indicates, in hindsight, that some 'left overs' have survived the 'cleanup' trap.