2013-10-15 04:47:05 -07:00
|
|
|
#!/usr/bin/env zsh
|
2013-03-21 19:25:43 -07:00
|
|
|
|
2013-11-30 09:50:49 -08:00
|
|
|
#
|
|
|
|
# [bin/update]
|
|
|
|
# A small script I use to update my mac/ubuntu/deb system (via homebrew or apt-get),
|
|
|
|
# zsh, vim and my local .vim and .dotfiles git repos.
|
|
|
|
#
|
|
|
|
# The real magic happens in the ./install/* scripts. There are others in there, in
|
|
|
|
# case I want to update/install something specific.
|
|
|
|
#
|
|
|
|
|
2013-03-23 01:02:58 -07:00
|
|
|
# Ask for the administrator password upfront
|
2013-03-22 10:21:05 -07:00
|
|
|
sudo -v
|
2013-03-23 01:02:58 -07:00
|
|
|
# Keep-alive: update existing `sudo` time stamp until script is done
|
|
|
|
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
|
|
|
|
|
2013-03-22 13:06:11 -07:00
|
|
|
# Update these scripts!
|
2013-11-30 09:50:49 -08:00
|
|
|
cd ~/.dotfiles
|
2013-10-18 04:03:28 -07:00
|
|
|
echo_g "==> Updating dotfiles"
|
2013-03-23 01:56:28 -07:00
|
|
|
git pull
|
2013-03-22 12:54:54 -07:00
|
|
|
|
2013-03-22 10:21:05 -07:00
|
|
|
# Updating the system with it's package manager (brew, apt-get, etc.)
|
2013-10-18 04:03:28 -07:00
|
|
|
echo_g "==> Updating installed packages"
|
|
|
|
pkg_update
|
2013-03-22 10:17:58 -07:00
|
|
|
|
2013-11-30 09:50:49 -08:00
|
|
|
# Now for zsh...
|
2013-10-15 15:57:23 -07:00
|
|
|
if command_exists zsh; then
|
2013-12-19 08:27:20 -08:00
|
|
|
echo_g "==> Updating zsh"
|
2013-10-15 15:57:23 -07:00
|
|
|
# Then the rest
|
|
|
|
install/zsh
|
|
|
|
echo
|
|
|
|
fi
|
2013-10-15 04:47:05 -07:00
|
|
|
|
2013-11-30 09:50:49 -08:00
|
|
|
# Then vim, if it's installed
|
2013-10-15 04:47:05 -07:00
|
|
|
if [ -d ~/.vim ]; then
|
2013-12-19 08:27:20 -08:00
|
|
|
echo_g "==> Updating vim"
|
2013-10-26 08:45:29 -07:00
|
|
|
cd ~/.vim
|
|
|
|
git pull
|
2013-10-15 04:47:05 -07:00
|
|
|
fi
|
2013-03-22 18:09:52 -07:00
|
|
|
|
2013-10-18 04:03:28 -07:00
|
|
|
echo_g "==> All done!"
|