helm/bin/update

47 lines
912 B
Plaintext
Raw Normal View History

#!/usr/bin/env zsh
set -e
indent() { sed 's/^/ /'; }
up-to-date() {
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse @{u})
[[ "$LOCAL" == "$REMOTE" ]]
}
(( $+commands[brew] )) && {
echo "Updating homebrew"
{ brew update; brew upgrade --all; brew cleanup } | indent
}
2016-02-25 21:11:48 -08:00
[ -f "$HOME/.emacs.d/Makefile" ] && {
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
}
local env=(rb py)
for i in $env
do
2016-02-25 21:11:48 -08:00
[ -d "$HOME/.${i}env" ] && {
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
}
done