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" ]]
|
|
|
|
}
|
|
|
|
|
|
|
|
(( $+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
|
|
|
}
|
|
|
|
|
2016-02-25 21:11:48 -08:00
|
|
|
[ -f "$HOME/.emacs.d/Makefile" ] && {
|
2015-12-13 03:46:47 -08:00
|
|
|
echo -n "Updating emacs"
|
|
|
|
cd "$HOME/.emacs.d" && make update | indent
|
|
|
|
}
|
|
|
|
|
2016-07-08 14:06:28 -07:00
|
|
|
[ -d ~/.zsh/zgen ] && {
|
|
|
|
echo "Updating zgen"
|
|
|
|
{
|
|
|
|
source "$HOME/.zgen/zgen.zsh"
|
|
|
|
zgen selfupdate
|
|
|
|
zgen update
|
|
|
|
} 2>&1 | indent
|
|
|
|
}
|
|
|
|
|
2015-12-13 03:46:47 -08:00
|
|
|
local env=(rb py)
|
|
|
|
for i in $env
|
|
|
|
do
|
2016-02-25 21:11:48 -08:00
|
|
|
[ -d "$HOME/.${i}env" ] && {
|
2015-12-13 03:46:47 -08:00
|
|
|
echo "Updating ${i}env"
|
|
|
|
{
|
2016-07-08 14:06:28 -07:00
|
|
|
for plugin in "$HOME"/.${i}env/plugins/*
|
|
|
|
do
|
|
|
|
cd "$plugin"
|
|
|
|
echo "+ `basename ${plugin}`"
|
|
|
|
git pull > /dev/null
|
|
|
|
done
|
2016-02-22 20:46:27 -08:00
|
|
|
} 2>&1 | indent
|
2015-12-13 03:46:47 -08:00
|
|
|
}
|
|
|
|
done
|
|
|
|
|