function cfs_init () {
(( $MVC_DEBUG )) && {
type_echo "$0 $FUNCNAME"
type_echo "\n"
}
CFS_ECHO_BUFFER_FORMAT=()
CFS_ECHO_BUFFER=()
return 0
}
function cfs_stow () {
# Here is the barrier at the edge of the Universe!
# `cfs_stow' is used to validate the operation of the only function call in the script.
# We should comment out the script debug flag statements, or the overlapping
# function specific debug flag statement.
(( $MVC_DEBUG )) && {
type_echo "$0 $FUNCNAME"
type_echo "\n"
}
(( ${DEBUG_CFS_STOW:-1} )) && {
echo "DEBUG_CFS_STOW $FUNCNAME $1 $2"
} > /dev/stderr
if [ -n "$2" ]; then
CFS_ECHO_BUFFER_FORMAT[$CFS_ECHO_INDEX]=$1
CFS_ECHO_BUFFER[$CFS_ECHO_INDEX]="$2"
let CFS_ECHO_INDEX++
fi
return 0
}
function cfs_dump () {
# Here we are well beyond the edge of the Universe.
# I don't want to use a function call for the
# only debug flag that exists in every function call.
# Though this is very sophisticated because of the redirection
# And, I leave the primative commented out to remind
# myself.
(( $MVC_DEBUG )) && {
type_echo "$0 $FUNCNAME"
type_echo "\n"
}
local -i background=
local -i foreground=
# (( ${DEBUG_CFS_ECHO:-1} )) && {
#
# echo $FUNCNAME $1 $2
#
# } > /dev/stderr
for (( x=0 ; $x < ${CFS_ECHO_INDEX:-0} ; x++ )); do
${TAB80} > /dev/stdout
if [ ${CFS_ECHO_BUFFER_FORMAT[$x]} -gt ${BACKGROUND} ]; then
let foreground=${CFS_ECHO_BUFFER_FORMAT[$x]}-10
let background=1
else
let foreground=${CFS_ECHO_BUFFER_FORMAT[$x]}
fi
# if [ ${CFS_ECHO_BUFFER_FORMAT[$x]} -eq ${RED} ]; then $FOREGROUND_RED ; fi
# if [ ${CFS_ECHO_BUFFER_FORMAT[$x]} -eq ${GREEN} ]; then $FOREGROUND_GREEN ; fi
{
if [ ${foreground} -eq ${RED} ]; then $FOREGROUND_RED ; fi
if [ ${foreground} -eq ${GREEN} ]; then $FOREGROUND_GREEN ; fi
if [ ${background} -eq 1 ]; then
$BACKGROUND_BLACK
fi
} > /dev/stdout
str=${CFS_ECHO_BUFFER[$x]}
len=${#str}
for ((y=$COLUMN_WIDTH-$len ; $y > 0; y-- )); do
str=$str$'\\032'
done
(( ${ENABLE_NORMAL_OUTPUT:-1} )) && {
{
echo -en "$str"
normal_carriage_return
} > /dev/stdout
}
done
return 0
} # cfs_echo ()
function move_directories () {
(( $MVC_DEBUG )) && {
type_echo "$0 $FUNCNAME"
type_echo "\n"
}
for file in continuity public_html src www-repository ; do
# Here's the validation for the called funtion
# and it doesn't go beyond the called function.
# And, it's on the right side of screen
# and if I had some brains I'd hit clear
# just once in the intire script
# and have little text boxes just like ...
(( ${POPULATE_CONTINUITY:-1} )) && {
let format=${RED}+${BACKGROUND}
cfs_stow ${format} "$file"
} > /dev/stderr
(( ${PERFORM_ACTION:-0} )) && {
mv "/home/continuity/$file" "/home/continuiy/$file-bak"
cp -r "/home/continuity-prime/$file" "/home/continuity"
}
done
return 0
} # move_directories ()
# -----------------------------------------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------------------------------
(( ${POPULATE_CONTINUITY:-1} )) && {
cfs_init
cfs_stow ${GREEN} "Pupulate Continuity Directory"
}
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
move_directories
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
(( ${POPULATE_CONTINUITY:-1} )) && {
cfs_dump
} > /dev/stderr
# -----------------------------------------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------------------------------