Add printStepIfDebug()

This commit is contained in:
Santiago Lo Coco 2022-01-06 11:09:25 -03:00
parent af1069d83d
commit 3fab8bfeff
1 changed files with 9 additions and 1 deletions

View File

@ -502,6 +502,14 @@ checkForSystemdUnit() {
trap - INT trap - INT
} }
printStepIfDebug() {
if [ $debugFlagToFile = true ] || [ $debugFlag = true ]; then
printf '\n%s' "============================================================" >> CocoASAIS.log
printf '\n%s\n' "$step" >> CocoASAIS.log
printf '%s\n' "============================================================" >> CocoASAIS.log
fi
}
steps=( steps=(
checkUefi checkUefi
updateSystemClock updateSystemClock
@ -567,7 +575,7 @@ runScript() {
while [ $i -lt "${#steps[@]}" ]; do while [ $i -lt "${#steps[@]}" ]; do
step=${steps[$i]} step=${steps[$i]}
[[ $debugFlagToStdout = true || $debugFlag = true ]] && printf '\n---\n%s\n---\n' "$step" >> CocoASAIS.log printStepIfDebug
saveVar "lastStep" "$step" saveVar "lastStep" "$step"
$step $step
((i++)) ((i++))