From ce4f5b5707fb59f07d3b8bd16809e6c2f49ddae3 Mon Sep 17 00:00:00 2001 From: Crazykev Date: Sat, 5 May 2018 23:45:52 -0700 Subject: [PATCH 1/2] fix binary operator error Signed-off-by: Crazykev --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 468aed5..21c00b6 100755 --- a/setup.sh +++ b/setup.sh @@ -9,7 +9,7 @@ vim::common::os(){ 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 ;; From 40a2179d3398c99dafbf859032e4216ab747ae80 Mon Sep 17 00:00:00 2001 From: Crazykev Date: Sat, 5 May 2018 23:47:18 -0700 Subject: [PATCH 2/2] avoid vim consider 'vim::common' as modelines Signed-off-by: Crazykev --- setup.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/setup.sh b/setup.sh index 21c00b6..56126d3 100755 --- a/setup.sh +++ b/setup.sh @@ -2,7 +2,7 @@ GOLANG_VERSION=${GOLANG_VERSION:-1.8.1} -vim::common::os(){ +vim_setup::common::os(){ PLATFORM=`uname` case $PLATFORM in Linux) @@ -24,16 +24,16 @@ 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)" @@ -41,7 +41,7 @@ vim::darwin::package(){ 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` @@ -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` @@ -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 @@ -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" }