Better update function

This commit is contained in:
Veit Heller
2014-06-30 14:29:04 +02:00
parent f9dcd11abc
commit b88376f929
2 changed files with 42 additions and 16 deletions

View File

@@ -65,12 +65,25 @@ pinfo(){
}
update(){
echo "Updating homebrew formulae"
brew update > /dev/null
echo "Updating installed sources(Homebrew)"
brew upgrade outdated &> /dev/null
echo "Updating MacPorts (sudo required)"
sudo port selfupdate > /dev/null
echo "Updating installed sources(MacPorts)"
sudo port upgrade outdated > /dev/null
yellow='\e[1;33m'
none='\e[0m'
if $1 == '-v' ; then
echo -e "${yellow}Updating homebrew formulae${none}"
brew update
echo -e "${yellow}Updating installed sources(Homebrew)${none}"
brew upgrade outdated
echo -e "${yellow}Updating MacPorts (sudo required)${none}"
sudo port selfupdate
echo -e "${yellow}Updating installed sources(MacPorts)${none}"
sudo port upgrade outdated
else
echo -e "${yellow}Updating homebrew formulae${none}"
brew update &> /dev/null
echo -e "${yellow}Updating installed sources(Homebrew)${none}"
brew upgrade outdated &> /dev/null
echo -e "${yellow}Updating MacPorts (sudo required)${none}"
sudo port selfupdate &> /dev/null
echo -e "${yellow}Updating installed sources(MacPorts)${none}"
sudo port upgrade outdated & /dev/null
fi
}

29
zshrc
View File

@@ -99,12 +99,25 @@ pinfo(){
}
update(){
echo "Updating homebrew formulae"
brew update > /dev/null
echo "Updating installed sources(Homebrew)"
brew upgrade outdated &> /dev/null
echo "Updating MacPorts (sudo required)"
sudo port selfupdate > /dev/null
echo "Updating installed sources(MacPorts)"
sudo port upgrade outdated > /dev/null
yellow='\e[1;33m'
none='\e[0m'
if $1 == '-v' ; then
echo -e "${yellow}Updating homebrew formulae${none}"
brew update
echo -e "${yellow}Updating installed sources(Homebrew)${none}"
brew upgrade outdated
echo -e "${yellow}Updating MacPorts (sudo required)${none}"
sudo port selfupdate
echo -e "${yellow}Updating installed sources(MacPorts)${none}"
sudo port upgrade outdated
else
echo -e "${yellow}Updating homebrew formulae${none}"
brew update &> /dev/null
echo -e "${yellow}Updating installed sources(Homebrew)${none}"
brew upgrade outdated &> /dev/null
echo -e "${yellow}Updating MacPorts (sudo required)${none}"
sudo port selfupdate &> /dev/null
echo -e "${yellow}Updating installed sources(MacPorts)${none}"
sudo port upgrade outdated & /dev/null
fi
}