Skip to content

Commit 6b2b05f

Browse files
ralyodioclaude
andcommitted
installer: 'tron upgrade' no-ops when already on the latest version
Compare installed VERSION with the latest release tag; if equal, print 'already up to date' instead of reinstalling. TB_FORCE=1 forces a reinstall. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 85a0e6c commit 6b2b05f

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

apps/web/public/install.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,20 @@ do_install() {
146146
}
147147

148148
do_upgrade() {
149-
if [ -f "$VERSION_FILE" ]; then info "Current: $(cat "$VERSION_FILE")"; else warn "TronBrowser not installed; installing fresh."; fi
149+
if [ ! -f "$VERSION_FILE" ]; then
150+
warn "TronBrowser not installed; installing fresh."
151+
do_install
152+
return
153+
fi
154+
current="$(cat "$VERSION_FILE")"
155+
latest="$(latest_tag)"
156+
[ -n "$latest" ] || err "could not resolve the latest release of $REPO"
157+
if [ "$current" = "$latest" ] && [ "${TB_FORCE:-0}" != "1" ]; then
158+
info "TronBrowser is already up to date ($current)."
159+
info "Re-install anyway with: TB_FORCE=1 tron upgrade"
160+
return
161+
fi
162+
info "Updating $current -> $latest"
150163
do_install
151164
}
152165

0 commit comments

Comments
 (0)