From d4eef318c3474be8623ab25c106888c916610c49 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Tue, 10 Mar 2015 11:58:50 -0400 Subject: [PATCH] Add rudimentary CentOS support --- files/zshrc | 3 ++- setup.sh | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/files/zshrc b/files/zshrc index 2b7f440..9b5e1dc 100644 --- a/files/zshrc +++ b/files/zshrc @@ -62,7 +62,8 @@ export EDITOR=vim alias asshole='sudo $(fc -l -n -1)' -export GOPATH=~/ +export GOROOT="$HOME"/go +export GOPATH="$HOME" setopt interactivecomments unsetopt beep bindkey '^[#' pound-insert diff --git a/setup.sh b/setup.sh index 42038a4..08e3cfc 100755 --- a/setup.sh +++ b/setup.sh @@ -91,14 +91,20 @@ if [[ "$UNAMESTR" == 'Linux' ]]; then fn_distro if [[ "$os" == Ubuntu* ]]; then sudo apt-get install -y build-essential git irssi vim-nox zsh tmux + [ -d "$HOME"/go ] || curl -L https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz | tar -xzC "$HOME" + elif [[ "$os" == CentOS* ]]; then + sudo yum install -y vim-enhanced zsh git fi elif [[ "$UNAMESTR" == 'Darwin' ]]; then # Probably need to set up brew and brew install some stuff here... - true + [ -d "$HOME"/go ] || curl -L https://storage.googleapis.com/golang/go1.4.2.darwin-amd64-osx10.8.tar.gz | tar -xzC "$HOME" fi +export GOROOT="$HOME"/go +export GOPATH=$HOME + if [[ ! -d "$DOTFILES" ]]; then - git clone git@git.chrissexton.org:cws/dotfiles.git "$DOTFILES" + git clone http://git.chrissexton.org/cws/dotfiles.git "$DOTFILES" elif [[ ! -d "$DOTFILES"/files ]]; then die "You must have a destination for the dotfiles repository!" fi @@ -122,13 +128,20 @@ cat "$DOTFILES"/files/gitignore_global > "$HOME"/.gitignore_global cat "$DOTFILES"/files/tmux.conf > "$HOME"/.tmux.conf cat "$DOTFILES"/files/vimrc > "$HOME"/.vimrc +if [[ "$os" == CentOS* ]]; then + sudo ln -s /usr/bin/vim /usr/local/bin/vi +fi if [[ ! -d "$HOME"/.oh-my-zsh ]]; then curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh fi if [[ ! "$SHELL" =~ .*zsh ]]; then - chsh -s "$(which zsh)" + if [[ "$os" == CentOS* ]]; then + chsh -s /bin/zsh + else + chsh -s "$(which zsh)" + fi fi cat "$DOTFILES"/files/zshrc > "$HOME"/.zshrc