Commit 73ef051a authored by Marc Cornellà's avatar Marc Cornellà
Browse files

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.
parent 9a832ccc
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
[*.sh]
indent_size = 4
indent_style = tab
...@@ -12,6 +12,7 @@ main() { ...@@ -12,6 +12,7 @@ main() {
if command_exists tput; then if command_exists tput; then
ncolors=$(tput colors) ncolors=$(tput colors)
fi fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)" RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)" GREEN="$(tput setaf 2)"
...@@ -68,7 +69,6 @@ main() { ...@@ -68,7 +69,6 @@ main() {
exit 1 exit 1
} }
printf "${BLUE}Looking for an existing zsh config...${NORMAL}\n" printf "${BLUE}Looking for an existing zsh config...${NORMAL}\n"
if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
printf "${YELLOW}Found ~/.zshrc.${NORMAL} ${GREEN}Backing up to ~/.zshrc.pre-oh-my-zsh${NORMAL}\n"; printf "${YELLOW}Found ~/.zshrc.${NORMAL} ${GREEN}Backing up to ~/.zshrc.pre-oh-my-zsh${NORMAL}\n";
...@@ -76,10 +76,10 @@ main() { ...@@ -76,10 +76,10 @@ main() {
fi fi
printf "${BLUE}Using the Oh My Zsh template file and adding it to ~/.zshrc${NORMAL}\n" printf "${BLUE}Using the Oh My Zsh template file and adding it to ~/.zshrc${NORMAL}\n"
cp "$ZSH"/templates/zshrc.zsh-template ~/.zshrc cp "$ZSH/templates/zshrc.zsh-template" ~/.zshrc
sed "/^export ZSH=/ c\\ sed "/^export ZSH=/ c\\
export ZSH=\"$ZSH\" export ZSH=\"$ZSH\"
" ~/.zshrc > ~/.zshrc-omztemp " ~/.zshrc > ~/.zshrc-omztemp
mv -f ~/.zshrc-omztemp ~/.zshrc mv -f ~/.zshrc-omztemp ~/.zshrc
# If this user's login shell is not already "zsh", attempt to switch. # If this user's login shell is not already "zsh", attempt to switch.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment