Skip to content

Commit ab7e5d9

Browse files
committed
feat(pinning): add s/p options for non-installed tools
- Extended [y/N/s/p] prompt to non-installed tools - Added 's' option for not-installed: Skip this version (prompt if newer) - Added 'p' option for not-installed: Never install (permanently skip) - When tool not installed and user selects 'p', pins to 'never' - Updated audit to treat pinned_version='never' as UP-TO-DATE - Suppresses install prompts for tools user doesn't want User experience: For installed tools: p = Pin to current version (don't ask for upgrades) For non-installed tools: p = Never install (permanently skip this tool) Example: ==> ❌ Ruby (rbenv) installed: <none> via unknown target: 3.4.7 Options: y = Install/upgrade now N = Skip (ask again next time) s = Skip version 3.4.7 (ask again if newer available) p = Never install (permanently skip this tool) Install/update? [y/N/s/p]
1 parent 6f07fab commit ab7e5d9

File tree

7 files changed

+49
-24
lines changed

7 files changed

+49
-24
lines changed

catalog/docker.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
"description": "Container platform for building and running applications",
55
"homepage": "https://www.docker.com",
66
"binary_name": "docker",
7-
"script": "install_docker.sh"
8-
,"guide": {
7+
"script": "install_docker.sh",
8+
"guide": {
99
"display_name": "Docker CLI",
1010
"install_action": "install",
1111
"order": 200
12-
}
12+
},
13+
"pinned_version": "29.0.0"
1314
}

catalog/node.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
"description": "Node.js JavaScript runtime",
55
"homepage": "https://nodejs.org",
66
"binary_name": "node",
7-
"script": "install_node.sh"
8-
,"guide": {
7+
"script": "install_node.sh",
8+
"guide": {
99
"display_name": "Node.js stack",
1010
"install_action": "reconcile",
1111
"order": 40
12-
}
12+
},
13+
"pinned_version": "25.0.0"
1314
}

catalog/ruby.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"github_repo": "ruby/ruby",
77
"binary_name": "ruby",
88
"script": "install_ruby.sh",
9-
"notes": "Installed via rbenv for version management. Removes apt-managed Ruby in favor of rbenv."
10-
,"guide": {
9+
"notes": "Installed via rbenv for version management. Removes apt-managed Ruby in favor of rbenv.",
10+
"guide": {
1111
"display_name": "Ruby (rbenv)",
1212
"install_action": "reconcile",
1313
"order": 32

cli_audit.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2515,6 +2515,21 @@ def audit_tool(tool: Tool) -> tuple[str, str, str, str, str, str, str, str]:
25152515
except Exception:
25162516
pass # Catalog read failed, continue with original status
25172517

2518+
# Check if tool is marked as "never install"
2519+
if status == "NOT INSTALLED":
2520+
script_dir = os.path.dirname(os.path.abspath(__file__))
2521+
catalog_file = os.path.join(script_dir, "catalog", f"{tool.name}.json")
2522+
if os.path.exists(catalog_file):
2523+
try:
2524+
with open(catalog_file, "r", encoding="utf-8") as f:
2525+
catalog_data = json.load(f)
2526+
pinned_version = catalog_data.get("pinned_version", "")
2527+
if pinned_version == "never":
2528+
# Tool is marked as never install - treat as up-to-date to suppress prompts
2529+
status = "UP-TO-DATE"
2530+
except Exception:
2531+
pass # Catalog read failed, continue with original status
2532+
25182533
# Sanitize latest display to numeric (like installed)
25192534
if latest_num:
25202535
latest_display = latest_num

latest_versions.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"gh:docker/compose": "latest_redirect",
2020
"gh:eradman/entr": "atom",
2121
"gh:eslint/eslint": "latest_redirect",
22-
"gh:git-lfs/git-lfs": "latest_redirect",
22+
"gh:git-lfs/git-lfs": "atom",
2323
"gh:git/git": "atom",
2424
"gh:gitleaks/gitleaks": "latest_redirect",
25-
"gh:golang/go": "tags_api",
25+
"gh:golang/go": "atom",
2626
"gh:golangci/golangci-lint": "latest_redirect",
2727
"gh:hashicorp/terraform": "latest_redirect",
2828
"gh:jqlang/jq": "latest_redirect",
@@ -36,7 +36,7 @@
3636
"gh:phiresky/ripgrep-all": "latest_redirect",
3737
"gh:prettier/prettier": "latest_redirect",
3838
"gh:profclems/glab": "latest_redirect",
39-
"gh:python/cpython": "tags_api",
39+
"gh:python/cpython": "atom",
4040
"gh:rs/curlie": "latest_redirect",
4141
"gh:ruby/ruby": "latest_redirect",
4242
"gh:rubygems/rubygems": "latest_redirect",

scripts/guide.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,18 @@ process_tool() {
117117
printf " will run: scripts/%s\n" "$install_cmd"
118118

119119
# Prompt with options explained
120+
printf " Options:\n"
121+
printf " y = Install/upgrade now\n"
122+
printf " N = Skip (ask again next time)\n"
120123
if [ -n "$installed" ]; then
121-
printf " Options:\n"
122-
printf " y = Install/upgrade now\n"
123-
printf " N = Skip (ask again next time)\n"
124124
printf " s = Skip version %s (ask again if newer available)\n" "$latest"
125125
printf " p = Pin to %s (don't ask for upgrades)\n" "$installed"
126+
else
127+
printf " s = Skip version %s (ask again if newer available)\n" "$latest"
128+
printf " p = Never install (permanently skip this tool)\n"
126129
fi
127130

128131
local prompt_text="Install/update? [y/N/s/p] "
129-
[ -z "$installed" ] && prompt_text="Install? [y/N] "
130132

131133
local ans=""
132134
if [ -t 0 ]; then
@@ -164,9 +166,15 @@ process_tool() {
164166
"$ROOT"/scripts/pin_version.sh "$tool" "$latest" || true
165167
;;
166168
[Pp])
167-
# Pin to current version
168-
printf " Pinning to current version %s\n" "$installed"
169-
"$ROOT"/scripts/pin_version.sh "$tool" "$installed" || true
169+
if [ -n "$installed" ]; then
170+
# Pin to current version
171+
printf " Pinning to current version %s\n" "$installed"
172+
"$ROOT"/scripts/pin_version.sh "$tool" "$installed" || true
173+
else
174+
# Never install - pin to "never"
175+
printf " Marking as 'never install' (permanently skip this tool)\n"
176+
"$ROOT"/scripts/pin_version.sh "$tool" "never" || true
177+
fi
170178
;;
171179
*)
172180
# User declined (N or empty)

tools_snapshot.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"__meta__": {
33
"count": 70,
4-
"created_at": "2025-10-21T05:58:11Z",
4+
"created_at": "2025-10-21T06:01:02Z",
55
"offline": false,
66
"partial_failures": 0,
77
"schema_version": 1
@@ -44,10 +44,10 @@
4444
"installed_method": "uv python",
4545
"installed_path_selected": "/home/cybot/.venvs/dev/bin/python",
4646
"installed_version": "3.14.0",
47-
"latest_upstream": "3.14.0",
48-
"latest_url": "https://github.com/python/cpython/releases/tag/v3.14.0",
49-
"latest_version": "3.14.0",
50-
"status": "UP-TO-DATE",
47+
"latest_upstream": "3.15.0",
48+
"latest_url": "https://github.com/python/cpython/releases/tag/v3.15.0a1",
49+
"latest_version": "3.15.0",
50+
"status": "OUTDATED",
5151
"tool": "python",
5252
"tool_url": "https://github.com/python/cpython",
5353
"upstream_method": "github"
@@ -197,7 +197,7 @@
197197
"latest_upstream": "3.4.7",
198198
"latest_url": "https://github.com/ruby/ruby/releases/tag/v3.4.7",
199199
"latest_version": "3.4.7",
200-
"status": "NOT INSTALLED",
200+
"status": "UP-TO-DATE",
201201
"tool": "ruby",
202202
"tool_url": "https://github.com/ruby/ruby",
203203
"upstream_method": "github"

0 commit comments

Comments
 (0)