Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Ubuntu #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

GOLANG_VERSION=${GOLANG_VERSION:-1.8.1}

vim::common::os(){
vim_setup::common::os(){
PLATFORM=`uname`
case $PLATFORM in
Linux)
if [ -e /etc/centos-release ]; then
OS=centos
elif [ -e /etc/os-release ]; then
if [ grep 'NAME="Ubuntu"' /etc/os-release ]; then
if [ `grep 'NAME="Ubuntu"' /etc/os-release` ]; then
OS=ubuntu
fi
fi ;;
Expand All @@ -24,24 +24,24 @@ vim::common::os(){
fi
}

vim::ubuntu::package(){
vim_setup::ubuntu::package(){
sudo apt-get install -y wget vim vim-gnome ctags xclip astyle python-setuptools python-dev git
}

vim::centos::package(){
vim_setup::centos::package(){
sudo yum install -y wget gcc vim git ctags xclip astyle python-setuptools python-devel
}

##Add HomeBrew support on Mac OS
vim::darwin::package(){
vim_setup::darwin::package(){
if ! which brew >/dev/null;then
echo "Install HomeBrew tool first"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
brew install vim ctags git astyle wget
}

vim::linux::golang(){
vim_setup::linux::golang(){
if which go > /dev/null; then
echo "Retain original golang Environment"
echo `go version`
Expand All @@ -60,7 +60,7 @@ EOF
source ~/.bashrc
}

vim::darwin::golang(){
vim_setup::darwin::golang(){
if which go > /dev/null; then
echo "Retain original golang Environment"
echo `go version`
Expand All @@ -80,7 +80,7 @@ EOF
source ~/.bash_profile
}

vim::common::setup(){
vim_setup::common::setup(){
GOPATH=${GOPATH:-$HOME/go-project}
mkdir -p ${GOPATH}
sudo easy_install -ZU autopep8
Expand All @@ -103,27 +103,27 @@ vim::common::setup(){
}

main(){
vim::common::os
vim_setup::common::os

case $OS in
ubuntu)
vim::ubuntu::package
vim::linux::golang
vim_setup::ubuntu::package
vim_setup::linux::golang

;;
centos)
vim::centos::package
vim::linux::golang
vim_setup::centos::package
vim_setup::linux::golang

;;
darwin)
vim::darwin::package
vim::darwin::golang
vim_setup::darwin::package
vim_setup::darwin::golang

;;
esac

vim::common::setup
vim_setup::common::setup
echo "Install finished"
}

Expand Down