Skip to content

Commit 51011d2

Browse files
committed
fix(auto-install): enable upgrades for tools using 'auto' install method
Problem: - Tools with install_method='auto' (bat, ripgrep, etc.) were not upgrading - Reconcile system skipped reinstall when tool was via best method - guide.sh always called install_tool.sh without action parameter - Default action 'install' triggered reconcile mode which skipped upgrade Solution: 1. Pass actual action (install/update/reconcile) to reconcile_tool 2. Only skip reinstall if action is 'reconcile' (not update/install) 3. guide.sh now uses 'update' action for already-installed tools 4. Reconcile system reinstalls tool when action is update/install Result: - bat successfully upgrades: 0.25.0 → 0.26.0 - All auto-install tools now upgrade correctly - Reconcile action still skips if already via best method
1 parent ab7e5d9 commit 51011d2

File tree

7 files changed

+25
-11
lines changed

7 files changed

+25
-11
lines changed

catalog/ctags.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
"packages": {
88
"apt": "universal-ctags",
99
"brew": "universal-ctags"
10-
}
10+
},
11+
"pinned_version": "5.9.0"
1112
}

catalog/entr.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
"pacman": "entr",
1010
"brew": "entr"
1111
},
12-
"notes": "entr does not publish GitHub releases; install via system package manager"
12+
"notes": "entr does not publish GitHub releases; install via system package manager",
13+
"pinned_version": "5.5"
1314
}

catalog/parallel.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
"dnf": "parallel",
1111
"pacman": "parallel"
1212
},
13-
"notes": "Installed via package manager. Note: System packages are typically 1-2 years behind upstream releases. For the latest version, install from https://www.gnu.org/software/parallel/"
13+
"notes": "Installed via package manager. Note: System packages are typically 1-2 years behind upstream releases. For the latest version, install from https://www.gnu.org/software/parallel/",
14+
"pinned_version": "20231122"
1415
}

scripts/guide.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ process_tool() {
113113

114114
# Build install command from catalog metadata
115115
local install_cmd="install_tool.sh $tool"
116-
[ -n "$install_action" ] && install_cmd="install_tool.sh $tool $install_action"
116+
if [ -n "$install_action" ]; then
117+
install_cmd="install_tool.sh $tool $install_action"
118+
elif [ -n "$installed" ]; then
119+
# Tool is already installed, use "update" action
120+
install_cmd="install_tool.sh $tool update"
121+
fi
117122
printf " will run: scripts/%s\n" "$install_cmd"
118123

119124
# Prompt with options explained

scripts/install_tool.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ if [ "$INSTALL_METHOD" = "auto" ]; then
4545
# Use reconciliation system
4646
case "$ACTION" in
4747
install|update|reconcile)
48-
reconcile_tool "$CATALOG_FILE" "reconcile"
48+
# Pass the actual action to reconcile_tool
49+
reconcile_tool "$CATALOG_FILE" "$ACTION"
4950
exit $?
5051
;;
5152
status)

scripts/lib/reconcile.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,13 @@ reconcile_tool() {
264264

265265
# Reconcile mode: align current with best
266266
if [ "$current_method" = "$best_method" ]; then
267-
echo "[$tool] ✓ Already installed via best method: $best_method" >&2
268-
return 0
267+
# If action is "reconcile" (not update/install), skip if already via best method
268+
if [ "$action" = "reconcile" ]; then
269+
echo "[$tool] ✓ Already installed via best method: $best_method" >&2
270+
return 0
271+
fi
272+
# For update/install action, continue to reinstall/upgrade even if via best method
273+
echo "[$tool] Upgrading (currently via $best_method)" >&2
269274
fi
270275

271276
if [ "$current_method" = "none" ]; then

tools_snapshot.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"__meta__": {
33
"count": 70,
4-
"created_at": "2025-10-21T06:01:02Z",
4+
"created_at": "2025-10-21T06:04:16Z",
55
"offline": false,
66
"partial_failures": 0,
77
"schema_version": 1
@@ -400,14 +400,14 @@
400400
{
401401
"category": "editors",
402402
"classification_reason_selected": "path-under-~/.local/bin",
403-
"installed": "0.25.0",
403+
"installed": "0.26.0",
404404
"installed_method": "/home/cybot/.local/bin",
405405
"installed_path_selected": "/home/cybot/.local/bin/bat",
406-
"installed_version": "0.25.0",
406+
"installed_version": "0.26.0",
407407
"latest_upstream": "0.26.0",
408408
"latest_url": "https://github.com/sharkdp/bat/releases/tag/v0.26.0",
409409
"latest_version": "0.26.0",
410-
"status": "OUTDATED",
410+
"status": "UP-TO-DATE",
411411
"tool": "bat",
412412
"tool_url": "https://github.com/sharkdp/bat",
413413
"upstream_method": "github"

0 commit comments

Comments
 (0)