From f92ac6ac37422e3b4ee445a67c10a1ee4fd3bdeb Mon Sep 17 00:00:00 2001 From: rootiest Date: Mon, 22 Jun 2026 02:16:41 -0400 Subject: [PATCH] fix(paru/yay-wrapper): resolve real binary instead of assuming /usr/bin The generated PTY-logging wrappers hardcoded /usr/bin/{paru,yay} both for the presence check and as the command the wrapper shells out to, breaking on any host where the binary lives elsewhere. Resolve the real path via __fish_real_command (which skips our own shim) and embed that. Bump the wrapper version 5 -> 6 so existing installs regenerate. --- conf.d/paru-wrapper.fish | 11 ++++++----- conf.d/yay-wrapper.fish | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/conf.d/paru-wrapper.fish b/conf.d/paru-wrapper.fish index a3d2a01..13e3159 100644 --- a/conf.d/paru-wrapper.fish +++ b/conf.d/paru-wrapper.fish @@ -2,7 +2,7 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # # Generates ~/.local/bin/paru on first run (and on version bump) when -# /usr/bin/paru is installed. The wrapper runs paru in a PTY so progress +# paru is installed. The wrapper runs paru in a PTY so progress # bars are preserved, renders the captured animation to a clean static log # (via scripts/clean_progress_log.py), and prunes old logs. @@ -19,12 +19,13 @@ if not __fish_config_op_enabled __fish_config_op_logging return end -set -l _paru_real /usr/bin/paru +# Resolve the real paru binary, skipping our own shim (never /usr/bin-assumed). +set -l _paru_real (__fish_real_command paru) set -l _paru_wrapper "$HOME/.local/bin/paru" -set -l _paru_wrapper_version 5 +set -l _paru_wrapper_version 6 # Skip entirely if the real paru binary isn't present -test -x $_paru_real; or return +test -x "$_paru_real"; or return # Check if wrapper already exists at the expected version if test -f $_paru_wrapper @@ -48,7 +49,7 @@ printf '%s\n' \ '' \ '# Build a safely-quoted command string for script(1).' \ '# script(1) allocates a PTY so paru detects a real terminal and shows progress.' \ - 'cmd_str="/usr/bin/paru"' \ + "cmd_str=\"$_paru_real\"" \ 'for arg in "$@"; do' \ ' cmd_str+=" $(printf '"'"'%q'"'"' "$arg")"' \ 'done' \ diff --git a/conf.d/yay-wrapper.fish b/conf.d/yay-wrapper.fish index 1a42a6b..203f306 100644 --- a/conf.d/yay-wrapper.fish +++ b/conf.d/yay-wrapper.fish @@ -2,7 +2,7 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # # Generates ~/.local/bin/yay on first run (and on version bump) when -# /usr/bin/yay is installed. The wrapper runs yay in a PTY so progress +# yay is installed. The wrapper runs yay in a PTY so progress # bars are preserved, renders the captured animation to a clean static log # (via scripts/clean_progress_log.py), and prunes old logs. @@ -19,12 +19,13 @@ if not __fish_config_op_enabled __fish_config_op_logging return end -set -l _yay_real /usr/bin/yay +# Resolve the real yay binary, skipping our own shim (never /usr/bin-assumed). +set -l _yay_real (__fish_real_command yay) set -l _yay_wrapper "$HOME/.local/bin/yay" -set -l _yay_wrapper_version 5 +set -l _yay_wrapper_version 6 # Skip entirely if the real yay binary isn't present -test -x $_yay_real; or return +test -x "$_yay_real"; or return # Check if wrapper already exists at the expected version if test -f $_yay_wrapper @@ -48,7 +49,7 @@ printf '%s\n' \ '' \ '# Build a safely-quoted command string for script(1).' \ '# script(1) allocates a PTY so yay detects a real terminal and shows progress.' \ - 'cmd_str="/usr/bin/yay"' \ + "cmd_str=\"$_yay_real\"" \ 'for arg in "$@"; do' \ ' cmd_str+=" $(printf '"'"'%q'"'"' "$arg")"' \ 'done' \