mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-06-19 05:12:49 +02:00
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'
This commit is contained in:
parent
825baeb310
commit
0605884fae
3 changed files with 123 additions and 0 deletions
31
plugins/installer/installer.plugin.zsh
Normal file
31
plugins/installer/installer.plugin.zsh
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#!/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
|
||||
Loading…
Add table
Add a link
Reference in a new issue