From d2ea935228552748e676c5f5128f59ebd426f19b Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sat, 21 Apr 2012 20:25:29 +0100 Subject: [PATCH] Change indentation from 4 for to 2 spaces in shell scripts --- install.sh | 132 ++++++++++++++++++++++++------------------------ shell/_main.sh | 8 +-- shell/emacs.sh | 4 +- shell/git.sh | 6 +-- shell/nodejs.sh | 2 +- shell/python.sh | 2 +- shell/ruby.sh | 6 +-- shell/tmux.sh | 2 +- shellrc.sh | 10 ++-- 9 files changed, 86 insertions(+), 86 deletions(-) diff --git a/install.sh b/install.sh index 0ee9c91..e4755fb 100755 --- a/install.sh +++ b/install.sh @@ -9,7 +9,7 @@ DOTFILES_LINK=".dotfiles" SYMLINK_PATH="$DOTFILES_LINK" PRIVATE_PATH="private" SYMLINKS=(bundle emacs.d erlang gemrc gitconfig gitignore hgrc irbrc \ - powconfig rspec tmux.conf) + powconfig rspec tmux.conf tmuxifier) LOAD_FILES=(profile zprofile) # @@ -17,39 +17,39 @@ LOAD_FILES=(profile zprofile) # install_symlinks () { - # Symlink dotfiles root - symlink "$ROOT_PATH" "$TARGET/$DOTFILES_LINK" + # Symlink dotfiles root + symlink "$ROOT_PATH" "$TARGET/$DOTFILES_LINK" - # Setup private dotfiles - if [ -f "$ROOT_PATH/$PRIVATE_PATH/install.sh" ]; then - "$ROOT_PATH/$PRIVATE_PATH/install.sh" links - fi + # Setup private dotfiles + if [ -f "$ROOT_PATH/$PRIVATE_PATH/install.sh" ]; then + "$ROOT_PATH/$PRIVATE_PATH/install.sh" links + fi - # Symlink each path - for i in ${SYMLINKS[@]}; do - symlink "$SYMLINK_PATH/$i" "$TARGET/.$i" - done + # Symlink each path + for i in ${SYMLINKS[@]}; do + symlink "$SYMLINK_PATH/$i" "$TARGET/.$i" + done - # Symlink shell init file for bash and zsh - for i in ${LOAD_FILES[@]}; do - symlink "$DOTFILES_LINK/load_shellrc.sh" "$TARGET/.$i" - done + # Symlink shell init file for bash and zsh + for i in ${LOAD_FILES[@]}; do + symlink "$DOTFILES_LINK/load_shellrc.sh" "$TARGET/.$i" + done } install_homebrew () { - /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" + /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)" } install_rbenv () { - git_clone 'git://github.com/sstephenson/rbenv.git' "$TARGET/.rbenv" + git_clone 'git://github.com/sstephenson/rbenv.git' "$TARGET/.rbenv" } install_nvm () { - git_clone 'https://github.com/creationix/nvm.git' "$TARGET/.nvm" + git_clone 'https://github.com/creationix/nvm.git' "$TARGET/.nvm" } install_virtualenv () { - curl -s https://raw.github.com/brainsik/virtualenv-burrito/master/virtualenv-burrito.sh | bash + curl -s https://raw.github.com/brainsik/virtualenv-burrito/master/virtualenv-burrito.sh | bash } @@ -58,12 +58,12 @@ install_virtualenv () { # if [ -n "${BASH_SOURCE[0]}" ] && [ -f "${BASH_SOURCE[0]}" ] ; then - ROOT_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) + ROOT_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) elif [ -n "$0" ] && [ -f "$0" ]; then - ROOT_PATH=$(cd "$(dirname "$0")" && pwd) + ROOT_PATH=$(cd "$(dirname "$0")" && pwd) else - echo "[ERROR] Can't determine dotfiles' root path." - exit 1 + echo "[ERROR] Can't determine dotfiles' root path." + exit 1 fi @@ -72,20 +72,20 @@ fi # symlink() { - if [ ! -e "$2" ]; then - echo " symlink: $2 --> $1" - ln -s "$1" "$2" - else - echo " exists: $2" - fi + if [ ! -e "$2" ]; then + echo " symlink: $2 --> $1" + ln -s "$1" "$2" + else + echo " exists: $2" + fi } git_clone () { - if [ ! -e "$2" ]; then - git clone "$1" "$2" - else - echo "[ERROR] $2 already exists" - fi + if [ ! -e "$2" ]; then + git clone "$1" "$2" + else + echo "[ERROR] $2 already exists" + fi } @@ -94,36 +94,36 @@ git_clone () { # case "$1" in - symlinks|links) - install_symlinks - ;; - homebrew|brew) - install_homebrew - ;; - rbenv) - install_rbenv - ;; - nvm) - install_nvm - ;; - virtualenv|venv) - install_virtualenv - ;; - info) - echo "Target directory: $TARGET" - echo "Detected dotfiles root: $ROOT_PATH" - ;; - *) - echo 'usage: ./install.sh [command]' - echo '' - echo 'Available commands:' - echo ' info: Target and source directory info.' - echo ' symlinks: Install symlinks for various dotfiles into' \ - 'target directory.' - echo ' homebrew: Install Homebrew (Mac OS X only).' - echo ' rbenv: Install rbenv, a Ruby version manager.' - echo ' nvm: Install nvm, a Node.js version manager.' - echo ' virtualenv: Install virtualenv-burrito, a Python version and' \ - 'environment manager.' - ;; + symlinks|links) + install_symlinks + ;; + homebrew|brew) + install_homebrew + ;; + rbenv) + install_rbenv + ;; + nvm) + install_nvm + ;; + virtualenv|venv) + install_virtualenv + ;; + info) + echo "Target directory: $TARGET" + echo "Detected dotfiles root: $ROOT_PATH" + ;; + *) + echo 'usage: ./install.sh [command]' + echo '' + echo 'Available commands:' + echo ' info: Target and source directory info.' + echo ' symlinks: Install symlinks for various dotfiles into' \ + 'target directory.' + echo ' homebrew: Install Homebrew (Mac OS X only).' + echo ' rbenv: Install rbenv, a Ruby version manager.' + echo ' nvm: Install nvm, a Node.js version manager.' + echo ' virtualenv: Install virtualenv-burrito, a Python version and' \ + 'environment manager.' + ;; esac diff --git a/shell/_main.sh b/shell/_main.sh index e806836..e8c4105 100644 --- a/shell/_main.sh +++ b/shell/_main.sh @@ -13,9 +13,9 @@ path_prepend "/usr/local/bin" # Load bash or zsh specific init files if [ -n "$BASH_VERSION" ]; then - source "$DOTSHELL/bashrc.sh" + source "$DOTSHELL/bashrc.sh" elif [ -n "$ZSH_VERSION" ]; then - source "$DOTSHELL/zshrc.sh" + source "$DOTSHELL/zshrc.sh" fi # Aliases @@ -62,6 +62,6 @@ path_prepend "./vendor/bundle/bin" # Ruby Bundler # Ensure TMPDIR is the same for local and remote ssh logins if [[ $TMPDIR == "/var/folders/"* ]] || [[ $TMPDIR == "" ]]; then - export TMPDIR="/tmp/user-$USER" - mkdir -p "$TMPDIR" + export TMPDIR="/tmp/user-$USER" + mkdir -p "$TMPDIR" fi diff --git a/shell/emacs.sh b/shell/emacs.sh index 0d77116..6ec9da5 100644 --- a/shell/emacs.sh +++ b/shell/emacs.sh @@ -3,8 +3,8 @@ # if [ -f "/Applications/Emacs.app/Contents/MacOS/Emacs" ]; then - alias emacs="/Applications/Emacs.app/Contents/MacOS/Emacs -nw" + alias emacs="/Applications/Emacs.app/Contents/MacOS/Emacs -nw" fi if [ -f "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient" ]; then - alias emacsclient="/Applications/Emacs.app/Contents/MacOS/bin/emacsclient" + alias emacsclient="/Applications/Emacs.app/Contents/MacOS/bin/emacsclient" fi diff --git a/shell/git.sh b/shell/git.sh index 0d6c2ad..da77152 100755 --- a/shell/git.sh +++ b/shell/git.sh @@ -21,11 +21,11 @@ alias gx="gitx" # Git Completion if [ -f "/usr/local/etc/bash_completion.d/git-completion.bash" ]; then - source "/usr/local/etc/bash_completion.d/git-completion.bash" + source "/usr/local/etc/bash_completion.d/git-completion.bash" fi # Only needed for Bash. Zsh is much smarter with it's auto-completion ^_^ if [ -n "$BASH_VERSION" ]; then - complete -o default -o nospace -F _git g - complete -o default -o nospace -F _git gi + complete -o default -o nospace -F _git g + complete -o default -o nospace -F _git gi fi diff --git a/shell/nodejs.sh b/shell/nodejs.sh index ae9aa96..e7bc549 100644 --- a/shell/nodejs.sh +++ b/shell/nodejs.sh @@ -4,5 +4,5 @@ # Load nvm if it's available if [ -f "$HOME/.nvm/nvm.sh" ]; then - source "$HOME/.nvm/nvm.sh" + source "$HOME/.nvm/nvm.sh" fi diff --git a/shell/python.sh b/shell/python.sh index 7ca6ed1..e8d2ff1 100644 --- a/shell/python.sh +++ b/shell/python.sh @@ -4,5 +4,5 @@ # Load virtualenv-burrito if it's available if [ -f "$HOME/.venvburrito/startup.sh" ]; then - source "$HOME/.venvburrito/startup.sh" + source "$HOME/.venvburrito/startup.sh" fi diff --git a/shell/ruby.sh b/shell/ruby.sh index be6fd9e..608abb7 100644 --- a/shell/ruby.sh +++ b/shell/ruby.sh @@ -22,8 +22,8 @@ alias va="bundle exec vagrant" # Load rbenv or RVM depending on which is available if [ -d "$HOME/.rbenv/bin" ]; then - export PATH="$HOME/.rbenv/bin:$PATH" - eval "$(rbenv init -)" + export PATH="$HOME/.rbenv/bin:$PATH" + eval "$(rbenv init -)" elif [ -s "$HOME/.rvm/scripts/rvm" ]; then - source "$HOME/.rvm/scripts/rvm" + source "$HOME/.rvm/scripts/rvm" fi diff --git a/shell/tmux.sh b/shell/tmux.sh index 452dd68..1d7c9e5 100644 --- a/shell/tmux.sh +++ b/shell/tmux.sh @@ -6,5 +6,5 @@ alias tml="tm ls" # Tmux Completion if [ -f "/usr/local/etc/bash_completion.d/tmux" ]; then - source "/usr/local/etc/bash_completion.d/tmux" + source "/usr/local/etc/bash_completion.d/tmux" fi diff --git a/shellrc.sh b/shellrc.sh index 78b17be..6359d52 100644 --- a/shellrc.sh +++ b/shellrc.sh @@ -4,21 +4,21 @@ # Set path to root of dotfiles if [ -n "${BASH_SOURCE[0]}" ] && [ -f "${BASH_SOURCE[0]}" ] ; then - DOTFILES="`dirname \"${BASH_SOURCE[0]}\"`" + DOTFILES="`dirname \"${BASH_SOURCE[0]}\"`" elif [ -n "$0" ] && [ -f "$0" ]; then - DOTFILES="`dirname \"$0\"`" + DOTFILES="`dirname \"$0\"`" elif [ -d "$HOME/.dotfiles" ]; then - DOTFILES="$HOME/.dotfiles" + DOTFILES="$HOME/.dotfiles" fi # Load main dotfiles DOTSHELL="$DOTFILES/shell" if [ -f "$DOTSHELL/_main.sh" ]; then - source "$DOTSHELL/_main.sh" + source "$DOTSHELL/_main.sh" fi # Setup and load private dotfiles DOTPFILES="$DOTFILES/private" if [ -f "$DOTPFILES/shellrc.sh" ]; then - source "$DOTPFILES/shellrc.sh" + source "$DOTPFILES/shellrc.sh" fi