From b72402e45219a5c3844fbfdbe9a6ead7fb5411eb Mon Sep 17 00:00:00 2001 From: Artem Sapegin Date: Wed, 12 Dec 2012 12:55:22 +0400 Subject: [PATCH] New update script. --- includes/bash_aliases.bash | 6 ++-- setup/imgo.sh | 4 +-- setup/stuff.sh | 6 ++-- setup/update.sh | 56 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 7 deletions(-) create mode 100755 setup/update.sh diff --git a/includes/bash_aliases.bash b/includes/bash_aliases.bash index 1da3836..c116935 100644 --- a/includes/bash_aliases.bash +++ b/includes/bash_aliases.bash @@ -36,11 +36,11 @@ alias rm="rm -i" # Gzip-enabled `curl` #alias gurl="curl --compressed" -# Get OS X Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages -alias update="sudo softwareupdate -i -a; brew update; brew upgrade; brew cleanup; npm update npm -g; npm update -g" +# Software/libraries update +alias update="source "$HOME/dotfiles/setup/update.sh"" # Update dotfiles -alias dotfiles="cd "$HOME/dotfiles" && git pull && ./sync.py && cd - > /dev/null 2>&1 && nyan" +alias dotfiles="cd "$HOME/dotfiles" && git pull && ./sync.py && . "$HOME/.bashrc" && cd - > /dev/null 2>&1 && nyan" # Clean up LaunchServices to remove duplicates in the “Open With” menu #alias lscleanup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder" diff --git a/setup/imgo.sh b/setup/imgo.sh index 839807b..433b9cb 100755 --- a/setup/imgo.sh +++ b/setup/imgo.sh @@ -6,8 +6,8 @@ brew install exiftool imagemagick optipng libjpeg gifsicle -formulas='pngout.rb defluff.rb cryopng.rb imgo.rb' +formulas='pngout.rb defluff.rb cryopng.rb imgo.rb' for package in $formulas do - brew install "https://raw.github.com/imgo/imgo-tools/master/Formula/"$package + brew install "https://raw.github.com/imgo/imgo-tools/master/Formula/"$package done diff --git a/setup/stuff.sh b/setup/stuff.sh index 4396bf0..50e9403 100755 --- a/setup/stuff.sh +++ b/setup/stuff.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Installs Homebrew, Git, git-extras, git-friendly, Node.js, configures Apache, PHP, MySQL, etc. +# Installs Homebrew, Git, git-extras, git-friendly, hub, Node.js, configures Apache, PHP, MySQL, etc. # Ask for the administrator password upfront sudo -v @@ -18,6 +18,7 @@ brew upgrade brew install coreutils # GNU `find`, `locate`, `updatedb`, and `xargs`, g-prefixed brew install findutils +brew install tree # More recent versions of some OS X tools brew tap homebrew/dupes @@ -26,6 +27,7 @@ brew install homebrew/dupes/grep # Git brew install git brew install git-extras +brew install hub sudo bash < <( curl https://raw.github.com/jamiew/git-friendly/master/install.sh) # MySQL @@ -52,7 +54,7 @@ brew install unrar # Node.js brew install node brew install casperjs -npm install -g grunt +npm install -g grunt-cli npm install -g jshint npm install -g bower diff --git a/setup/update.sh b/setup/update.sh new file mode 100755 index 0000000..cb78ef9 --- /dev/null +++ b/setup/update.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +# Get OS X Software Updates, update Homebrew, NPM, Ruby packages, dotfiles and some other software + +function header() { + echo -e "$(tput sgr 0 1)$(tput setaf 6)$1$(tput sgr0)" +} + +# Ask for the administrator password upfront +sudo -v +echo + +# Dotfiles +header "Updating dotfiles..." +cd "$HOME/dotfiles" +git pull +./sync.py +source "$HOME/.bashrc" +cd - > /dev/null 2>&1 +echo + +# OS X +header "Updating OS X..." +sudo softwareupdate -i -a +echo + +# Homebrew +header "Updating Homebrew..." +brew update +brew upgrade +brew cleanup +echo + +# NPM +header "Updating NPM..." +npm update npm -g +npm update -g +echo + +# Ruby gems +header "Updating Ruby gems..." +sudo gem update +echo + +# Python +header "Updating Python packages..." +sudo pip install --upgrade fabric +echo + +# git-friendly +header "Updating git-friendly..." +sudo bash < <( curl https://raw.github.com/jamiew/git-friendly/master/install.sh) +echo + +# Nyan cat! Yay! +nyan \ No newline at end of file