From 878bc360d9d487ddfdcd7a6d9692d6800888c280 Mon Sep 17 00:00:00 2001 From: rootiest Date: Mon, 22 Jun 2026 00:55:30 -0400 Subject: [PATCH] fix(fish-deps): detect tools with command -q so wrappers don't mask missing binaries Status, install, and update resolved catalog entries with `type -q`, which also matches wrapper functions that shadow a tool name (rg, rm, yt-dlp). A shadowed-but-uninstalled tool was reported "installed", skipped by `install`, and skipped by `update`. Switch these catalog-bin probes to `command -q`/`command -s` (PATH only). PM/build-tool probes (cargo, uv, paru, yay, ...) and the fisher check (a fish function) keep `type -q`. --- functions/_fish_deps_install.fish | 4 +++- functions/_fish_deps_status.fish | 6 ++++-- functions/_fish_deps_update.fish | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/functions/_fish_deps_install.fish b/functions/_fish_deps_install.fish index 1af829d..5003830 100644 --- a/functions/_fish_deps_install.fish +++ b/functions/_fish_deps_install.fish @@ -22,7 +22,9 @@ function _fish_deps_install # Determine if this dep needs attention: missing, or fish < 4.0 set -l needs_install 0 set -l upgrade_label Install - if not type -q $bin + # command -q (not type -q): a wrapper function shadowing the name + # (rg, rm, yt-dlp) must not be mistaken for the installed binary. + if not command -q $bin set needs_install 1 else if test "$bin" = fish set -l _major (fish --version 2>&1 | string match -r 'version (\d+)')[2] diff --git a/functions/_fish_deps_status.fish b/functions/_fish_deps_status.fish index ec23692..4ed2882 100644 --- a/functions/_fish_deps_status.fish +++ b/functions/_fish_deps_status.fish @@ -14,7 +14,9 @@ function _fish_deps_status _fish_deps_catalog function __fds_print_dep --argument-names bin tier - if type -q $bin + # command -q (not type -q): probe PATH only, so wrapper functions that + # shadow a tool name (rg, rm, yt-dlp) don't mask a missing binary. + if command -q $bin # Special version check: fish < 4.0 is functionally incompatible if test "$bin" = fish set -l _major (fish --version 2>&1 | string match -r 'version (\d+)')[2] @@ -28,7 +30,7 @@ function _fish_deps_status end set_color green; echo -n " ✓ "; set_color normal echo -n "$bin " - set_color brblack; echo "(Found at "(type -p $bin)")"; set_color normal + set_color brblack; echo "(Found at "(command -s $bin)")"; set_color normal else if test "$tier" = rec set_color yellow; echo -n " ⚠ "; set_color normal echo -n "$bin " diff --git a/functions/_fish_deps_update.fish b/functions/_fish_deps_update.fish index 1b7a2b7..1555fd5 100644 --- a/functions/_fish_deps_update.fish +++ b/functions/_fish_deps_update.fish @@ -26,8 +26,9 @@ function _fish_deps_update set -l i 1 for bin in $_fdc_bins - # Skip fisher itself (handled above) and tools that aren't installed - if test "$bin" = fisher; or not type -q $bin + # Skip fisher itself (handled above) and tools that aren't installed. + # command -q (not type -q): ignore wrapper functions shadowing the name. + if test "$bin" = fisher; or not command -q $bin set i (math $i + 1) continue end