helm/zsh/lib/os

44 lines
631 B
Plaintext
Raw Normal View History

function is_deb {
command_exists apt-get
}
function is_mac {
[[ $(uname) == 'Darwin' ]]
}
function is_linux {
[[ $(uname) == 'Linux' ]]
}
if is_mac; then
2013-10-18 04:03:28 -07:00
function pkg_install() {
brew install $1
}
2013-10-18 04:03:28 -07:00
function pkg_remove() {
brew remove $1
}
2013-10-18 04:03:28 -07:00
function pkg_update() {
brew update && brew upgrade
}
elif is_deb; then
2013-10-18 04:03:28 -07:00
function pkg_install() {
2013-05-05 15:14:07 -07:00
sudo apt-get -y install $1
}
2013-10-18 04:03:28 -07:00
function pkg_remove() {
2013-05-05 15:14:07 -07:00
sudo apt-get -y remove $1
}
2013-10-18 04:03:28 -07:00
function pkg_update() {
sudo apt-get update && sudo apt-get upgrade
}
fi
2013-03-22 18:10:59 -07:00
# vim:set ft=zsh: