ohmyzsh/plugins/installer/installer.plugin.zsh
Walter A. Boring IV 5fde95d6e5 Added the installer plugin
This plugin creates 2 aliases "in and up" that are system
and distro agnostic.   For example,
on Mac in = brew install
on SUSE in = sudo -E zypper install
on Debian in = sudo -E apt-get install
on RedHat in = sudo -E yum install

add the 'installer' to your plugin list in ~/.zshrc
source ~/.zshrc

now you can run
'in wget'
'up curl'
2018-06-29 14:37:19 -04:00

31 lines
718 B
Bash

#!/bin/zsh
#
# System agnostic installer aliasing
#
# Assumes if you are on a mac, brew is used
# Suse = zypper
# ubuntu/debian = apt
# Redhat = yum
#
source "${0:h}/core.sh"
case $OS in
'mac')
alias in='brew install'
alias up='brew upgrade'
;;
'linux')
if [[ "$DIST" == "ubuntu" ]]; then
alias in="sudo -E apt-get install"
alias up="sudo -E apt-get upgrade"
elif [[ "$DIST" == "suse" ]]; then
alias in="sudo -E zypper in"
alias up="sudo -E zypper up"
elif [[ "$DIST" == "redhat" ]]; then
alias in="sudo -E yum install"
alias up="sudo -E yup upgrade"
fi
;;
*) ;;
esac