2013-03-22 10:15:50 -07:00
|
|
|
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() {
|
2013-03-22 10:15:50 -07:00
|
|
|
brew install $1
|
|
|
|
}
|
|
|
|
|
2013-10-18 04:03:28 -07:00
|
|
|
function pkg_remove() {
|
2013-03-22 10:15:50 -07:00
|
|
|
brew remove $1
|
|
|
|
}
|
|
|
|
|
2013-10-18 04:03:28 -07:00
|
|
|
function pkg_update() {
|
2013-03-22 10:15:50 -07:00
|
|
|
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-03-22 10:15:50 -07:00
|
|
|
}
|
|
|
|
|
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-03-22 10:15:50 -07:00
|
|
|
}
|
|
|
|
|
2013-10-18 04:03:28 -07:00
|
|
|
function pkg_update() {
|
2013-03-22 10:15:50 -07:00
|
|
|
sudo apt-get update && sudo apt-get upgrade
|
|
|
|
}
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
2013-03-22 18:10:59 -07:00
|
|
|
# vim:set ft=zsh:
|