Skip to content

Commit

Permalink
Merge pull request #67 from willeccles/homebrew
Browse files Browse the repository at this point in the history
Add homebrew support
  • Loading branch information
willeccles authored Jan 19, 2023
2 parents 6f55d21 + a84e07f commit 107cc12
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ sudo make install
- emerge (Gentoo)
- dnf (Fedora)
- guix (non-system-wide Guix)
- Homebrew
- lunar (Lunar)
- MacPorts (macOS)
- pacman (Arch)
- pkg (FreeBSD and OpenBSD)
- slackpkg (Slackware)
- sorcery (Source Mage)
- urpmi (Mageia)
- xbps (Void)
- zypper (OpenSUSE)
- pkg (FreeBSD and OpenBSD)

## Explicitly unsupported package managers

- Cargo
- Flatpak
- Homebrew
- Nix
- NPM
- Pip
Expand Down
19 changes: 17 additions & 2 deletions cpm
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,22 @@ _macports() {
esac
}

_brew() {
case "$OP" in
install) brew install "$@";;
remove) brew uninstall "$@";;
list) brew list;;
count) brew list | tot;;
update) brew update;;
upgrade) brew update && brew upgrade;;
search) brew search "$@";;
show) brew info "$@";;
files) pem "unsupported operation";;
from) pem "unsupported operation";;
clean) brew cleanup;;
esac
}

_xbps() {
case "$OP" in
install) su_do xbps-install "$@";;
Expand Down Expand Up @@ -527,8 +543,7 @@ else
if has port; then
_macports "$@"
elif has brew; then
pem "Homebrew is not supported [wontfix]"
exit 1
_brew "$@"
else
pem "No valid package manager detected."
exit 1
Expand Down

0 comments on commit 107cc12

Please sign in to comment.