mirror of
https://github.com/dmduran12/pymc_console-dist.git
synced 2026-03-28 17:43:04 +01:00
Sync build v0.9.169
Automated sync from private repository. Commit: b9057ca00f0679e691123ce96b90954ffc6fe492
This commit is contained in:
@@ -399,24 +399,49 @@ do_upgrade() {
|
|||||||
branch=$(cd "$CLONE_DIR" && git rev-parse --abbrev-ref HEAD 2>/dev/null) || branch="$DEFAULT_BRANCH"
|
branch=$(cd "$CLONE_DIR" && git rev-parse --abbrev-ref HEAD 2>/dev/null) || branch="$DEFAULT_BRANCH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Confirm
|
# Component selection checklist
|
||||||
if ! ask_yes_no "Confirm Upgrade" "\nThis will upgrade:\n• pyMC_Repeater ($branch branch)\n• pyMC Console dashboard\n\nYour configuration will be preserved.\n\nContinue?"; then
|
local choices
|
||||||
|
choices=$($DIALOG --backtitle "pyMC Console" --title "Select Components" \
|
||||||
|
--checklist "\nSelect what to upgrade:\n\nYour configuration will be preserved." 14 55 2 \
|
||||||
|
"console" "pyMC Console dashboard" ON \
|
||||||
|
"repeater" "pyMC_Repeater ($branch)" ON \
|
||||||
|
3>&1 1>&2 2>&3) || return 0
|
||||||
|
|
||||||
|
local upgrade_console=false
|
||||||
|
local upgrade_repeater=false
|
||||||
|
[[ "$choices" == *"console"* ]] && upgrade_console=true
|
||||||
|
[[ "$choices" == *"repeater"* ]] && upgrade_repeater=true
|
||||||
|
|
||||||
|
# Nothing selected
|
||||||
|
if [[ "$upgrade_console" == false && "$upgrade_repeater" == false ]]; then
|
||||||
|
show_info "Nothing Selected" "No components selected for upgrade."
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
print_banner
|
print_banner
|
||||||
|
|
||||||
# Step 1: Update clone
|
# Calculate steps
|
||||||
print_step 1 3 "Updating pyMC_Repeater"
|
local step=1
|
||||||
clone_upstream "$branch"
|
local total=0
|
||||||
|
[[ "$upgrade_repeater" == true ]] && ((total+=2)) # clone + upgrade
|
||||||
|
[[ "$upgrade_console" == true ]] && ((total++))
|
||||||
|
|
||||||
# Step 2: Run upstream upgrade
|
# Upgrade Repeater if selected
|
||||||
print_step 2 3 "Upgrading pyMC_Repeater"
|
if [[ "$upgrade_repeater" == true ]]; then
|
||||||
run_upstream "upgrade" || return 1
|
print_step $step $total "Updating pyMC_Repeater source"
|
||||||
|
clone_upstream "$branch"
|
||||||
|
((step++))
|
||||||
|
|
||||||
|
print_step $step $total "Upgrading pyMC_Repeater"
|
||||||
|
run_upstream "upgrade" || return 1
|
||||||
|
((step++))
|
||||||
|
fi
|
||||||
|
|
||||||
# Step 3: Update dashboard (files only, web_path preserved)
|
# Upgrade Console if selected
|
||||||
print_step 3 3 "Updating dashboard"
|
if [[ "$upgrade_console" == true ]]; then
|
||||||
install_dashboard
|
print_step $step $total "Updating dashboard"
|
||||||
|
install_dashboard
|
||||||
|
fi
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
local ip=$(hostname -I 2>/dev/null | awk '{print $1}')
|
local ip=$(hostname -I 2>/dev/null | awk '{print $1}')
|
||||||
|
|||||||
Reference in New Issue
Block a user