Files
fish-config/functions/_fish_deps_detect_pm.fish
T
rootiest 00055a7c38 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.
2026-06-06 02:41:10 -04:00

23 lines
566 B
Fish

# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# SYNOPSIS
# _fish_deps_detect_pm
#
# DESCRIPTION
# Detects and prints the name of the first available system package manager
# 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 zypper yum
if type -q $pm
echo $pm
return
end
end
echo ""
end