aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/copy_menu.sh
diff options
context:
space:
mode:
authorDon Williams <don.e.williams@gmail.com>2026-01-15 02:25:36 -0500
committerDon Williams <don.e.williams@gmail.com>2026-01-15 02:25:36 -0500
commit122f607047b16488c95ea25e842084d88b394e1d (patch)
tree9b66d5620293ef77ee58342b34acddb8c0afe752 /scripts/copy_menu.sh
parentb8c823fbab99f857c933e9b45609ab21cee55f31 (diff)
Removed python script didn't work
On branch development Your branch is up to date with 'origin/development'. Changes to be committed: deleted: copy-menu-issue.txt modified: scripts/copy_menu.sh deleted: scripts/tui_menu.py
Diffstat (limited to 'scripts/copy_menu.sh')
-rwxr-xr-xscripts/copy_menu.sh73
1 files changed, 36 insertions, 37 deletions
diff --git a/scripts/copy_menu.sh b/scripts/copy_menu.sh
index 258c2fae..87f9301f 100755
--- a/scripts/copy_menu.sh
+++ b/scripts/copy_menu.sh
@@ -22,47 +22,17 @@ show_copy_menu() {
local quit_desc="Exit without changes"
local choice=""
-
- # Prefer Python TUI if available (mouse + keyboard, styled hotkeys, help)
- # Determine repo dir robustly: prefer SCRIPT_DIR if set by caller (copy.sh); fallback to this file's parent
- local __self_dir __repo_dir
- __self_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
- __repo_dir="${SCRIPT_DIR:-$(cd "${__self_dir}/.." 2>/dev/null && pwd)}"
- local py_menu="${__repo_dir}/scripts/tui_menu.py"
-if command -v python3 >/dev/null 2>&1 && [ -f "$py_menu" ]; then
- # Allow forcing backend via COPY_TUI_BACKEND=auto|textual|curses|basic
- if [ -n "$COPY_TUI_BACKEND" ]; then
- if choice=$(python3 "$py_menu" --express-supported "$express_supported" --backend "$COPY_TUI_BACKEND"); then
- COPY_MENU_CHOICE="$choice"
- return 0
- fi
- else
- if choice=$(python3 "$py_menu" --express-supported "$express_supported"); then
- COPY_MENU_CHOICE="$choice"
- return 0
- fi
- fi
- fi
-
- # Fallback to whiptail if present
- if command -v whiptail >/dev/null 2>&1; then
- if ! choice=$(whiptail --title "$menu_title" --menu "$prompt" 17 60 8 \
- "$install_tag" "$install_desc" \
- "$upgrade_tag" "$upgrade_desc" \
- "$express_tag" "$express_desc" \
- "$update_tag" "$update_desc" \
- "$quit_tag" "$quit_desc" 3>&1 1>&2 2>&3); then
- COPY_MENU_CHOICE="quit"
- return 1
- fi
- else
- # Plain-text fallback
+ run_basic_menu() {
while true; do
printf "\n%s\n" "$menu_title"
printf "%s\n" "$prompt"
printf " 1) Install - %s\n" "$install_desc"
printf " 2) Upgrade - %s\n" "$upgrade_desc"
- printf " 3) Express - %s\n" "$express_desc"
+ if [ "$express_supported" -eq 1 ]; then
+ printf " 3) Express - %s\n" "$express_desc"
+ else
+ printf " 3) Express - %s (disabled)\n" "$express_desc"
+ fi
printf " 4) Update - %s\n" "$update_desc"
printf " 5) Quit - %s\n" "$quit_desc"
printf "Enter choice [1-5]: "
@@ -70,12 +40,41 @@ if command -v python3 >/dev/null 2>&1 && [ -f "$py_menu" ]; then
case "$text_choice" in
1) choice="$install_tag"; break ;;
2) choice="$upgrade_tag"; break ;;
- 3) choice="$express_tag"; break ;;
+ 3)
+ if [ "$express_supported" -eq 1 ]; then
+ choice="$express_tag"
+ break
+ else
+ echo "Express is disabled on this system."
+ fi
+ ;;
4) choice="$update_tag"; break ;;
5) choice="$quit_tag"; break ;;
*) echo "Invalid selection. Please choose 1-5." ;;
esac
done
+ }
+
+ if [ "$COPY_TUI_BACKEND" = "basic" ]; then
+ run_basic_menu
+ COPY_MENU_CHOICE="$choice"
+ return 0
+ fi
+
+ # Fallback to whiptail if present
+ if command -v whiptail >/dev/null 2>&1; then
+ if ! choice=$(whiptail --title "$menu_title" --menu "$prompt" 17 60 8 \
+ "$install_tag" "$install_desc" \
+ "$upgrade_tag" "$upgrade_desc" \
+ "$express_tag" "$express_desc" \
+ "$update_tag" "$update_desc" \
+ "$quit_tag" "$quit_desc" 3>&1 1>&2 2>&3); then
+ COPY_MENU_CHOICE="quit"
+ return 1
+ fi
+ else
+ # Plain-text fallback
+ run_basic_menu
fi
# shellcheck disable=SC2034 # used by parent script after sourcing this file
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage