feat: fullscreen TUI with progress bar for module execution
This commit is contained in:
11
install.sh
11
install.sh
@@ -9,6 +9,7 @@ export OMERON_PROJECT_DIR="$OMERON_ROOT"
|
||||
|
||||
source "$OMERON_ROOT/lib/log.sh"
|
||||
source "$OMERON_ROOT/lib/tui.sh"
|
||||
source "$OMERON_ROOT/lib/tui-fs.sh"
|
||||
source "$OMERON_ROOT/lib/utils.sh"
|
||||
source "$OMERON_ROOT/lib/config.sh"
|
||||
source "$OMERON_ROOT/lib/modules.sh"
|
||||
@@ -259,12 +260,16 @@ main() {
|
||||
local total=${#modules_to_run[@]}
|
||||
local idx=1
|
||||
|
||||
tui_fs_init
|
||||
local fs_active=$?
|
||||
|
||||
for module_path in "${modules_to_run[@]}"; do
|
||||
local description=""
|
||||
if source "$module_path" 2>/dev/null && declare -F "module_description" >/dev/null 2>&1; then
|
||||
description="$(module_description)"
|
||||
fi
|
||||
printf '\n'
|
||||
|
||||
((fs_active == 0)) && tui_fs_set_overall "$idx" "$total" "${description:-$(basename "$module_path" .sh)}"
|
||||
log_step "$idx" "$total" "${description:-$(basename "$module_path" .sh)}"
|
||||
|
||||
module_run "$module_path" || {
|
||||
@@ -272,15 +277,19 @@ main() {
|
||||
if declare -F "module_required" >/dev/null 2>&1; then
|
||||
source "$module_path"
|
||||
if module_required 2>/dev/null; then
|
||||
((fs_active == 0)) && tui_fs_exit
|
||||
tui_error "Required module failed. Aborting."
|
||||
exit $rc
|
||||
fi
|
||||
fi
|
||||
tui_warn "Module completed with warnings"
|
||||
}
|
||||
((fs_active == 0)) && tui_fs_set_progress 100
|
||||
((idx++))
|
||||
done
|
||||
|
||||
((fs_active == 0)) && tui_fs_exit
|
||||
|
||||
printf '\n'
|
||||
tui_header "O M E R O N — Done"
|
||||
tui_success "Installation Complete!"
|
||||
|
||||
Reference in New Issue
Block a user