Skip to content

Commit bd2bdd5

Browse files
ralyodioclaude
andcommitted
installer: ship a 'tron' CLI; homepage shows tron upgrade/remove/version
Replace the confusing 'curl | sh -s -- upgrade' management UX. The installer now drops a 'tron' CLI on PATH (tronbrowser alias): tron launches the browser, tron upgrade/remove/version manage it. Homepage + web README updated to match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e4ef743 commit bd2bdd5

3 files changed

Lines changed: 87 additions & 22 deletions

File tree

apps/web/README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,23 @@ Marketing site + web dashboard for TronBrowser.
1010
- `public/install.sh` — served at **https://tronbrowser.dev/install.sh**.
1111

1212
```bash
13-
# install (default), then the usual commands:
13+
# one-line install:
1414
curl -fsSL https://tronbrowser.dev/install.sh | sh
15-
curl -fsSL https://tronbrowser.dev/install.sh | sh -s -- upgrade
16-
curl -fsSL https://tronbrowser.dev/install.sh | sh -s -- remove
17-
curl -fsSL https://tronbrowser.dev/install.sh | sh -s -- version
1815
```
1916

2017
The installer detects OS/arch, pulls the latest GitHub release artifact, installs
21-
under `$TRONBROWSER_PREFIX` (default `~/.local`), and symlinks `tronbrowser` onto
22-
`$PREFIX/bin`. `remove` keeps the user's profile/bookmarks/history.
18+
under `$TRONBROWSER_PREFIX` (default `~/.local`), and drops a **`tron`** CLI onto
19+
`$PREFIX/bin` (with a `tronbrowser` alias). After install, manage it with `tron`:
20+
21+
```bash
22+
tron # launch the browser (tron <url> opens URLs)
23+
tron upgrade # update to the latest release
24+
tron remove # uninstall (keeps your profile data)
25+
tron version # print the installed version
26+
```
27+
28+
The bootstrap installer also accepts `… | sh -s -- {install,upgrade,remove,version,help}`
29+
for use before `tron` exists on PATH.
2330

2431
Preview the static site locally:
2532

apps/web/public/index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@
5656
<button onclick="copyCmd()">copy</button>
5757
</div>
5858
<div class="sub">
59-
Then manage it with the usual commands:<br />
60-
<code>… | sh -s -- upgrade</code> &nbsp;·&nbsp;
61-
<code>… | sh -s -- remove</code> &nbsp;·&nbsp;
62-
<code>tronbrowser --version</code>
59+
Then use the <code>tron</code> CLI:<br />
60+
<code>tron</code> to launch &nbsp;·&nbsp;
61+
<code>tron upgrade</code> &nbsp;·&nbsp;
62+
<code>tron remove</code> &nbsp;·&nbsp;
63+
<code>tron version</code>
6364
<br />Windows &amp; manual downloads on the
6465
<a href="https://github.com/profullstack/tronbrowser.dev/releases">releases page</a>.
6566
</div>

apps/web/public/install.sh

Lines changed: 69 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
#!/bin/sh
22
# TronBrowser installer.
33
# curl -fsSL https://tronbrowser.dev/install.sh | sh
4-
# curl -fsSL https://tronbrowser.dev/install.sh | sh -s -- upgrade
5-
# curl -fsSL https://tronbrowser.dev/install.sh | sh -s -- remove
64
#
7-
# Commands: install (default) | upgrade | remove | version | help
5+
# After install, manage TronBrowser with the `tron` CLI:
6+
# tron launch the browser
7+
# tron upgrade update to the latest release
8+
# tron remove uninstall (keeps your profile data)
9+
# tron version print the installed version
10+
#
11+
# This installer also accepts: install (default) | upgrade | remove | version | help
812
# Env: TRONBROWSER_PREFIX (default $HOME/.local), TRONBROWSER_REPO
913
set -eu
1014

1115
REPO="${TRONBROWSER_REPO:-profullstack/tronbrowser.dev}"
1216
PREFIX="${TRONBROWSER_PREFIX:-$HOME/.local}"
1317
APP_DIR="$PREFIX/lib/tronbrowser"
14-
BIN_LINK="$PREFIX/bin/tronbrowser"
18+
CURRENT="$APP_DIR/current" # stable symlink -> the browser binary
19+
TRON_CLI="$PREFIX/bin/tron" # the user-facing CLI
20+
ALIAS_CLI="$PREFIX/bin/tronbrowser" # alias -> tron
1521
VERSION_FILE="$APP_DIR/VERSION"
22+
INSTALL_URL="https://tronbrowser.dev/install.sh"
1623

1724
say() { printf '%s\n' "$*"; }
1825
info() { printf '\033[36m==>\033[0m %s\n' "$*"; }
@@ -45,6 +52,52 @@ latest_tag() {
4552
sed -n 's/.*"tag_name":[[:space:]]*"\([^"]*\)".*/\1/p' /tmp/tb_rel.json | head -n1
4653
}
4754

55+
# Writes the `tron` management CLI to $PREFIX/bin/tron.
56+
write_cli() {
57+
mkdir -p "$PREFIX/bin"
58+
cat > "$TRON_CLI" <<'TRON'
59+
#!/bin/sh
60+
# tron — TronBrowser CLI
61+
set -eu
62+
PREFIX="${TRONBROWSER_PREFIX:-$HOME/.local}"
63+
APP_DIR="$PREFIX/lib/tronbrowser"
64+
CURRENT="$APP_DIR/current"
65+
VERSION_FILE="$APP_DIR/VERSION"
66+
INSTALL_URL="https://tronbrowser.dev/install.sh"
67+
68+
usage() {
69+
cat <<USAGE
70+
tron — TronBrowser CLI
71+
72+
Usage:
73+
tron [url...] Launch TronBrowser (optionally opening URLs)
74+
tron upgrade Update to the latest release
75+
tron remove Uninstall TronBrowser (keeps your profile data)
76+
tron version Print the installed version
77+
tron help Show this help
78+
USAGE
79+
}
80+
81+
case "${1:-}" in
82+
upgrade|update)
83+
exec sh -c "curl -fsSL '$INSTALL_URL' | sh -s -- upgrade" ;;
84+
remove|uninstall)
85+
rm -rf "$APP_DIR"
86+
rm -f "$PREFIX/bin/tron" "$PREFIX/bin/tronbrowser"
87+
echo "Removed TronBrowser. (Profile data kept; delete ~/.tronbrowser to wipe it.)" ;;
88+
version|--version|-v)
89+
cat "$VERSION_FILE" 2>/dev/null || echo "not installed" ;;
90+
help|--help|-h)
91+
usage ;;
92+
*)
93+
[ -x "$CURRENT" ] || { echo "TronBrowser is not installed. Run: curl -fsSL $INSTALL_URL | sh" >&2; exit 1; }
94+
exec "$CURRENT" "$@" ;;
95+
esac
96+
TRON
97+
chmod +x "$TRON_CLI"
98+
ln -sf "$TRON_CLI" "$ALIAS_CLI"
99+
}
100+
48101
do_install() {
49102
need uname
50103
asset="$(detect_asset)"
@@ -67,16 +120,18 @@ do_install() {
67120
[ -n "$bin" ] || bin="$(find "$APP_DIR" -maxdepth 3 -type f -name 'TronBrowser' 2>/dev/null | head -n1)"
68121
[ -n "$bin" ] || err "browser binary not found in archive"
69122
chmod +x "$bin"
70-
ln -sf "$bin" "$BIN_LINK"
123+
ln -sf "$bin" "$CURRENT"
71124
echo "$tag" > "$VERSION_FILE"
72125

73-
info "Installed to $APP_DIR"
74-
say " binary: $BIN_LINK"
126+
write_cli
127+
128+
info "Installed TronBrowser $tag to $APP_DIR"
129+
say " launch: tron"
130+
say " manage: tron upgrade | tron remove | tron version"
75131
case ":$PATH:" in
76132
*":$PREFIX/bin:"*) : ;;
77-
*) warn "$PREFIX/bin is not on PATH — add it to use 'tronbrowser' directly." ;;
133+
*) warn "$PREFIX/bin is not on PATH — add it so 'tron' is available." ;;
78134
esac
79-
say "Run: tronbrowser"
80135
}
81136

82137
do_upgrade() {
@@ -87,8 +142,8 @@ do_upgrade() {
87142
do_remove() {
88143
info "Removing TronBrowser"
89144
rm -rf "$APP_DIR"
90-
[ -L "$BIN_LINK" ] && rm -f "$BIN_LINK"
91-
say "Removed. (User profile/bookmarks/history are kept; delete ~/.tronbrowser to wipe data.)"
145+
rm -f "$TRON_CLI" "$ALIAS_CLI"
146+
say "Removed. (Profile/bookmarks/history kept; delete ~/.tronbrowser to wipe data.)"
92147
}
93148

94149
do_version() {
@@ -99,7 +154,7 @@ usage() {
99154
cat <<EOF
100155
TronBrowser installer
101156
102-
Usage: install.sh [command]
157+
Usage: curl -fsSL $INSTALL_URL | sh [-s -- <command>]
103158
104159
Commands:
105160
install Download and install the latest TronBrowser (default)
@@ -108,6 +163,8 @@ Commands:
108163
version Print the installed version
109164
help Show this help
110165
166+
After install, prefer the 'tron' CLI: tron upgrade | tron remove | tron version
167+
111168
Env:
112169
TRONBROWSER_PREFIX install prefix (default: \$HOME/.local)
113170
TRONBROWSER_REPO GitHub repo (default: $REPO)

0 commit comments

Comments
 (0)