feat(pkg): add cross-platform package manager support
Refactor pkg.fish to auto-detect the system package manager via _fish_deps_detect_pm instead of hard-requiring paru/yay. Supports install, uninstall, and auto (toggle) modes across paru, yay, pacman, apt, dnf, zypper, yum, brew, and pkg. Package installed-checks now use the correct query tool per PM (pacman -Qi, dpkg -s, rpm -q, etc.). Also adds zypper to the _fish_deps_detect_pm detection priority list.
This commit is contained in:
@@ -6,13 +6,13 @@
|
||||
#
|
||||
# DESCRIPTION
|
||||
# Detects and prints the name of the first available system package manager
|
||||
# from the priority list: paru, yay, pacman, apt, brew, pkg, dnf, yum.
|
||||
# from the priority list: paru, yay, pacman, apt, brew, pkg, dnf, zypper, yum.
|
||||
# Prints an empty string if none are found.
|
||||
#
|
||||
# EXAMPLE
|
||||
# set pm (_fish_deps_detect_pm)
|
||||
function _fish_deps_detect_pm
|
||||
for pm in paru yay pacman apt brew pkg dnf yum
|
||||
for pm in paru yay pacman apt brew pkg dnf zypper yum
|
||||
if type -q $pm
|
||||
echo $pm
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user