-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.opensource.sh
More file actions
41 lines (28 loc) · 909 Bytes
/
install.opensource.sh
File metadata and controls
41 lines (28 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
args=$@;
describe "Installing Epel"
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
describe "Installing golang and dependencies"
yum install -y golang
additional_packages=""
if [ ! -z "$(echo $args| grep 'include-git')" ]; then
additional_packages="$additional_packages git"
fi
if [ ! -z "$(echo $args| grep 'include-hg')" ]; then
additional_packages="$additional_packages hg"
fi
if [ ! -z "$additional_packages" ]; then
describe "Installing additional packages ${$additional_packages}"
yum install -y $additional_packages
fi
if [ ! -d "$HOME/.go" ]; then
describe "Creating Go dir in $HOME/.go and exporting GOPATH and etc."
mkdir $HOME/.go
mkdir $HOME/.go/bin
export GOPATH=$HOME/.go
export PATH=$PATH:$GOPATH/bin
cat >> ~/.bashrc << EOF
export GOPATH=\$HOME/.go
export PATH=\$PATH:\$GOPATH/bin
EOF
fi
success "Golang was installed successfully"