Move update() to its own script
This commit is contained in:
parent
15c2a771ad
commit
4b8319c7da
30
bin/update
Executable file
30
bin/update
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Homebrew #####################
|
||||||
|
brew update
|
||||||
|
brew upgrade
|
||||||
|
|
||||||
|
|
||||||
|
# RUBY #########################
|
||||||
|
|
||||||
|
# Make sure rvm is sourced properly
|
||||||
|
if [ -f ~/.rvm/scripts/rvm ]; then
|
||||||
|
[ "$(type -t rvm)" = "function" ] || source ~/.rvm/scripts/rvm
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Update all rubies and rubygems
|
||||||
|
for v in 1.9.3 1.8.7; do
|
||||||
|
rvm use $v
|
||||||
|
gem update --system
|
||||||
|
gem update
|
||||||
|
done
|
||||||
|
|
||||||
|
# Update system ruby
|
||||||
|
rvm use system
|
||||||
|
sudo gem update --system
|
||||||
|
sudo gem update
|
||||||
|
|
||||||
|
|
||||||
|
# Vim ##########################
|
||||||
|
echo "[NOTICE] Updating vim..."
|
||||||
|
vim +BundleInstall! +BundleClean! +q +q
|
49
zsh/aliases
49
zsh/aliases
|
@ -1,23 +1,24 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#######################
|
#############
|
||||||
# Aliases
|
# Aliases #
|
||||||
|
#############
|
||||||
|
|
||||||
alias ll='ls -l'
|
alias ll='ls -l'
|
||||||
alias la='ls -la'
|
alias la='ls -la'
|
||||||
|
|
||||||
alias zrc='vim ~/.zshrc'
|
# Directories ##################
|
||||||
|
|
||||||
# Directories
|
|
||||||
alias dev='cd /usr/local/dev'
|
alias dev='cd /usr/local/dev'
|
||||||
alias w='cd ~/Work/'
|
alias w='cd ~/Work/'
|
||||||
alias wd='cd ~/Work/Dev/'
|
alias wd='cd ~/Work/Dev/'
|
||||||
alias wp='cd ~/Work/Projects/'
|
alias wp='cd ~/Work/Projects/'
|
||||||
|
|
||||||
# Vim
|
# Vim ##########################
|
||||||
alias v='mvim'
|
alias v='mvim'
|
||||||
|
|
||||||
# Git
|
# Git ##########################
|
||||||
|
# I know the git oh-my-zsh plugin has most of these, but
|
||||||
|
# I prefer to specify my own
|
||||||
alias g='git'
|
alias g='git'
|
||||||
alias ga='g a'
|
alias ga='g a'
|
||||||
alias gap='g a -p'
|
alias gap='g a -p'
|
||||||
|
@ -27,36 +28,12 @@ alias gd='g d'
|
||||||
alias gr='g r'
|
alias gr='g r'
|
||||||
alias gbr='g br'
|
alias gbr='g br'
|
||||||
|
|
||||||
# Laravel (already provided in zsh plugin)
|
# Laravel ######################
|
||||||
# alias artisan='php artisan'
|
# (already provided in zsh plugin)
|
||||||
# alias bob='php artisan bob::build'
|
#alias artisan='php artisan'
|
||||||
|
#alias bob='php artisan bob::build'
|
||||||
|
|
||||||
|
# Open a file in Mac OS's quick-look
|
||||||
function quick-look() {
|
function quick-look() {
|
||||||
(( $# > 0 )) && qlmanage -p $* &>/dev/null &
|
(( $# > 0 )) && qlmanage -p $* &>/dev/null &
|
||||||
}
|
}
|
||||||
|
|
||||||
function update() {
|
|
||||||
# Update homebrew
|
|
||||||
brew update
|
|
||||||
brew upgrade
|
|
||||||
|
|
||||||
# Keep sudo alive
|
|
||||||
sudo -v
|
|
||||||
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
|
|
||||||
|
|
||||||
# Make sure rvm is sourced properly
|
|
||||||
if [ -f ~/.rvm/scripts/rvm ]; then
|
|
||||||
[ "$(type -t rvm)" = "function" ] || source ~/.rvm/scripts/rvm
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Update all rubies and rubygems
|
|
||||||
for v in 1.9.3 1.8.7 system; do
|
|
||||||
rvm use $v
|
|
||||||
gem update --system
|
|
||||||
gem update
|
|
||||||
done
|
|
||||||
|
|
||||||
# Update vim
|
|
||||||
echo "[NOTICE] Updating vim..."
|
|
||||||
screen -d -m vim +BundleInstall! +BundleClean! +q +q
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue