Summary
The check_path() function at line 865 checks if INSTALL_DIR is anywhere in PATH (:${PATH}: substring search) but doesn't verify it's early enough in the PATH precedence order to actually be invoked. If a user has an older binary in /usr/bin and installs a new one to ~/.local/bin but ~/.local/bin comes after /usr/bin in PATH, the shell will invoke the older version without warning. The install script suggests prepending INSTALL_DIR to PATH (line 876) but doesn't verify this suggestion was followed, nor does it detect if an earlier PATH entry shadows the newly installed binary.
Where
install.sh:865-892 (check_path function)
install.sh:876 (PATH prepend suggestion)
install.sh:668-673 (existing binary detection)
Suggested approach
- After successful install, resolve the active binary path via
command -v or type -p and verify it points to the newly installed $EXISTING_BIN
- If it returns a different path, warn that a shadowing binary exists earlier in PATH
- Parse PATH entries in order (
: delimited) and check each for an executable
- If shadowing is detected, print the full chain of binaries found and their versions
- Offer automated PATH reordering (with user consent) to prepend INSTALL_DIR if not already first
- Test the resolved binary path against the installed binary path to confirm no shadowing remains
Summary
The check_path() function at line 865 checks if INSTALL_DIR is anywhere in PATH (
:${PATH}:substring search) but doesn't verify it's early enough in the PATH precedence order to actually be invoked. If a user has an older binary in /usr/bin and installs a new one to ~/.local/bin but ~/.local/bin comes after /usr/bin in PATH, the shell will invoke the older version without warning. The install script suggests prepending INSTALL_DIR to PATH (line 876) but doesn't verify this suggestion was followed, nor does it detect if an earlier PATH entry shadows the newly installed binary.Where
install.sh:865-892(check_path function)install.sh:876(PATH prepend suggestion)install.sh:668-673(existing binary detection)Suggested approach
command -vortype -pand verify it points to the newly installed $EXISTING_BIN:delimited) and check each for an executable