diff --git a/README.md b/README.md index 7df9aa0..cd7e47e 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ bash <(curl -sL https://go.scity.us/install-tapm) -To switch an installed main-branch copy to V2 for testing: +To update an installed main-branch copy, switch it to V2, and immediately load +the V2 menu: tapm V2 diff --git a/proxmenu-scripts.sh b/proxmenu-scripts.sh index d8bfca4..28dcf78 100755 --- a/proxmenu-scripts.sh +++ b/proxmenu-scripts.sh @@ -6,6 +6,12 @@ source /opt/idssys/defaults/default.inc source /opt/idssys/ta-proxmenu/defaults.inc +# An older run.sh may update main on disk while continuing to execute its +# already-loaded code. Hand V2 to the new launcher loaded from disk. +if [[ "${1:-}" == "V2" ]]; then + exec /opt/idssys/ta-proxmenu/run.sh V2 +fi + INSTALL_PULSE() { echo bash <(curl -fsSL https://github.com/rcourtman/Pulse/releases/latest/download/install.sh) @@ -419,4 +425,3 @@ exit 0 - diff --git a/run.sh b/run.sh index ded2d16..1482477 100755 --- a/run.sh +++ b/run.sh @@ -22,8 +22,7 @@ SWITCH_TO_V2() { return 1 fi if [[ "$current_branch" == "V2" ]]; then - echo -e "${idsCL[Green]}TA-ProxMenu is already using 'V2'.${idsCL[Default]}" - return 0 + exec /opt/idssys/ta-proxmenu/run.sh fi if [[ -n "$(git -C "$repository" status --porcelain --untracked-files=normal)" ]]; then echo -e "${idsCL[LightYellow]}TA-ProxMenu has local changes; branch switching was refused to preserve them.${idsCL[Default]}" @@ -68,7 +67,8 @@ SWITCH_TO_V2() { fi rm -f /var/cache/ta-proxmenu/update-status 2>/dev/null || true - echo -e "${idsCL[Green]}TA-ProxMenu is now using branch 'V2'.${idsCL[Default]}" + echo -e "${idsCL[Green]}TA-ProxMenu is now using branch 'V2'. Loading the V2 menu...${idsCL[Default]}" + exec /opt/idssys/ta-proxmenu/run.sh } if [[ "${1:-}" == "V2" ]]; then