73ef051aaecd5a63b84585bf67e263642660abb4

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

installer: use tabs to allow future heredocs

This will allow us to use tab stripping heredocs with `<<-'.
See http://www.tldp.org/LDP/abs/html/here-docs.html#EX71A

Add editorconfig file to enforce this style.
See http://editorconfig.org for more information.

Diff

This diff is truncated to protect this page.

  1diff --git a/.editorconfig b/.editorconfig
  2new file mode 100644
  3index 0000000000000000000000000000000000000000..aa18e0e5cde98f57ffe1ea57610902d37993ae2d
  4--- /dev/null
  5+++ b/.editorconfig
  6@@ -0,0 +1,10 @@
  7+root = true
  8+
  9+[*]
 10+end_of_line = lf
 11+insert_final_newline = true
 12+charset = utf-8
 13+
 14+[*.sh]
 15+indent_size = 4
 16+indent_style = tab
 17diff --git a/tools/install.sh b/tools/install.sh
 18index 5c5419b1783e0cf045b2dfd062324e2a976c7e06..b1327af41a667b173bf3ab93df4b6f332c5a7a76 100755
 19--- a/tools/install.sh
 20+++ b/tools/install.sh
 21@@ -3,116 +3,116 @@ set -e
 22 
 23 # Test command existence (POSIX compatible)
 24 command_exists() {
 25-  command -v "$@" >/dev/null 2>&1
 26+	command -v "$@" >/dev/null 2>&1
 27 }
 28 
 29 main() {
 30-  # Use colors, but only if connected to a terminal, and that terminal
 31-  # supports them.
 32-  if command_exists tput; then
 33-    ncolors=$(tput colors)
 34-  fi
 35-  if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
 36-    RED="$(tput setaf 1)"
 37-    GREEN="$(tput setaf 2)"
 38-    YELLOW="$(tput setaf 3)"
 39-    BLUE="$(tput setaf 4)"
 40-    BOLD="$(tput bold)"
 41-    NORMAL="$(tput sgr0)"
 42-  else
 43-    RED=""
 44-    GREEN=""
 45-    YELLOW=""
 46-    BLUE=""
 47-    BOLD=""
 48-    NORMAL=""
 49-  fi
 50+	# Use colors, but only if connected to a terminal, and that terminal
 51+	# supports them.
 52+	if command_exists tput; then
 53+		ncolors=$(tput colors)
 54+	fi
 55 
 56-  if ! command_exists zsh; then
 57-    printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n"
 58-    exit 1
 59-  fi
 60+	if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
 61+		RED="$(tput setaf 1)"
 62+		GREEN="$(tput setaf 2)"
 63+		YELLOW="$(tput setaf 3)"
 64+		BLUE="$(tput setaf 4)"
 65+		BOLD="$(tput bold)"
 66+		NORMAL="$(tput sgr0)"
 67+	else
 68+		RED=""
 69+		GREEN=""
 70+		YELLOW=""
 71+		BLUE=""
 72+		BOLD=""
 73+		NORMAL=""
 74+	fi
 75 
 76-  if [ ! -n "$ZSH" ]; then
 77-    ZSH=~/.oh-my-zsh
 78-  fi
 79+	if ! command_exists zsh; then
 80+		printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n"
 81+		exit 1
 82+	fi
 83 
 84-  if [ -d "$ZSH" ]; then
 85-    printf "${YELLOW}You already have Oh My Zsh installed.${NORMAL}\n"
 86-    printf "You'll need to remove $ZSH if you want to re-install.\n"
 87-    exit 1
 88-  fi
 89+	if [ ! -n "$ZSH" ]; then
 90+		ZSH=~/.oh-my-zsh
 91+	fi
 92 
 93-  # Prevent the cloned repository from having insecure permissions. Failing to do
 94-  # so causes compinit() calls to fail with "command not found: compdef" errors
 95-  # for users with insecure umasks (e.g., "002", allowing group writability). Note
 96-  # that this will be ignored under Cygwin by default, as Windows ACLs take
 97-  # precedence over umasks except for filesystems mounted with option "noacl".
 98-  umask g-w,o-w
 99+	if [ -d "$ZSH" ]; then
100+		printf "${YELLOW}You already have Oh My Zsh installed.${NORMAL}\n"
101+		printf "You'll need to remove $ZSH if you want to re-install.\n"
102+		exit 1
103+	fi
104 
105-  printf "${BLUE}Cloning Oh My Zsh...${NORMAL}\n"
106-  command_exists git || {
107-    echo "Error: git is not installed"
108-    exit 1
109-  }
110-  # The Windows (MSYS) Git is not compatible with normal use on cygwin
111-  if [ "$OSTYPE" = cygwin ]; then
112-    if git --version | grep msysgit > /dev/null; then
113-      echo "Error: Windows/MSYS Git is not supported on Cygwin"
114-      echo "Error: Make sure the Cygwin git package is installed and is first on the path"
115-      exit 1
116-    fi
117-  fi
118-  env git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git "$ZSH" || {
119-    printf "Error: git clone of oh-my-zsh repo failed\n"
120-    exit 1