43 lines
		
	
	
		
			1,001 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			1,001 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
#!/usr/bin/env zsh
 | 
						|
 | 
						|
#
 | 
						|
# [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.
 | 
						|
#
 | 
						|
 | 
						|
# Ask for the administrator password upfront
 | 
						|
sudo -v
 | 
						|
# 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 &
 | 
						|
 | 
						|
# Update these scripts!
 | 
						|
cd ~/.dotfiles
 | 
						|
echo_g "==> Updating dotfiles"
 | 
						|
git pull
 | 
						|
 | 
						|
# Updating the system with it's package manager (brew, apt-get, etc.)
 | 
						|
echo_g "==> Updating installed packages"
 | 
						|
pkg_update
 | 
						|
 | 
						|
# Now for zsh...
 | 
						|
if command_exists zsh; then
 | 
						|
    echo_g "==> Updating zsh, rvm and vim"
 | 
						|
    # Then the rest
 | 
						|
    install/zsh
 | 
						|
    echo
 | 
						|
fi
 | 
						|
 | 
						|
# Then vim, if it's installed
 | 
						|
if [ -d ~/.vim ]; then
 | 
						|
    cd ~/.vim
 | 
						|
    git pull
 | 
						|
    cd ~/.dotfiles
 | 
						|
    install/vim
 | 
						|
fi
 | 
						|
 | 
						|
echo_g "==> All done!"
 |