2015-12-13 03:46:47 -08:00
|
|
|
#!/usr/bin/env zsh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
indent() { sed 's/^/ /'; }
|
2015-12-20 20:40:38 -08:00
|
|
|
up-to-date() {
|
2015-12-13 03:46:47 -08:00
|
|
|
LOCAL=$(git rev-parse @)
|
|
|
|
REMOTE=$(git rev-parse @{u})
|
|
|
|
[[ "$LOCAL" == "$REMOTE" ]]
|
|
|
|
}
|
|
|
|
|
2015-12-20 20:40:38 -08:00
|
|
|
sudo softwareupdate -i -a
|
|
|
|
|
2015-12-13 03:46:47 -08:00
|
|
|
(( $+commands[brew] )) && {
|
|
|
|
echo "Updating homebrew"
|
2015-12-20 20:40:38 -08:00
|
|
|
{ brew update; brew upgrade --all; brew cleanup } | indent
|
2015-12-13 03:46:47 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
[[ -f "$HOME/.emacs.d/Makefile" ]] && {
|
|
|
|
echo -n "Updating emacs"
|
|
|
|
cd "$HOME/.emacs.d" && make update | indent
|
|
|
|
}
|
|
|
|
|
|
|
|
local env=(rb py)
|
|
|
|
for i in $env
|
|
|
|
do
|
|
|
|
[[ -d "$HOME/.${i}env" ]] && {
|
|
|
|
echo "Updating ${i}env"
|
|
|
|
{
|
|
|
|
if ! up-to-date; then
|
|
|
|
echo "UPDATING"
|
|
|
|
git pull > /dev/null
|
|
|
|
fi
|
|
|
|
|
|
|
|
{
|
|
|
|
for plugin in "$HOME"/.${i}env/plugins/*
|
|
|
|
do
|
|
|
|
cd "$plugin"
|
|
|
|
if ! up-to-date; then
|
|
|
|
echo "+ UPDATING `basename ${plugin}`"
|
|
|
|
git pull > /dev/null
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
} 2&>1 | indent
|
|
|
|
} 2&>1 | indent
|
|
|
|
}
|
|
|
|
done
|
|
|
|
|
|
|
|
[[ -d ~/.zsh/zgen ]] && {
|
|
|
|
echo "Updating zgen"
|
|
|
|
{
|
|
|
|
source "$HOME/.zsh/zgen/zgen.zsh"
|
|
|
|
zgen selfupdate
|
|
|
|
zgen update
|
|
|
|
} 2&>1 | indent
|
|
|
|
}
|
|
|
|
|