Add some special path variables and add centos-ci dependencies

Now we'll really fix the centos-ci build I think :)
This commit is contained in:
James Shubin
2016-02-10 18:09:01 -05:00
parent f4da8756bd
commit 83caea1bdc
3 changed files with 17 additions and 6 deletions

47
misc/make-path.sh Executable file
View File

@@ -0,0 +1,47 @@
#!/bin/bash
# setup a few environment path values
if ! env | grep -q '^GOPATH='; then
export GOPATH="$HOME/gopath/"
mkdir "$GOPATH"
if ! grep -q '^export GOPATH=' ~/.bashrc; then
echo "export GOPATH=~/gopath/" >> ~/.bashrc
fi
echo "setting go path to: $GOPATH"
fi
echo "gopath is: $GOPATH"
# some versions of golang apparently require this to run go get :(
if ! env | grep -q '^GOBIN='; then
export GOBIN="${GOPATH}bin/"
mkdir "$GOBIN"
if ! grep -q '^export GOBIN=' ~/.bashrc; then
echo 'export GOBIN="${GOPATH}bin/"' >> ~/.bashrc
fi
echo "setting go bin to: $GOBIN"
fi
echo "gobin is: $GOBIN"
# add gobin to $PATH
if ! env | grep '^PATH=' | grep -q "$GOBIN"; then
if ! grep -q '^export PATH="'"${GOBIN}:${PATH}"'"' ~/.bashrc; then
echo 'export PATH="'"${GOBIN}"':'"${PATH}"'"' >> ~/.bashrc
fi
export PATH="${PATH}" # basically useless
echo "setting path to: $PATH"
fi
echo "path is: $PATH"
# add ~/bin/ to $PATH
if ! env | grep '^PATH=' | grep -q "$HOME/bin"; then
if ! grep -q '^export PATH="'"${HOME}/bin:${PATH}"'"' ~/.bashrc; then
echo 'export PATH="'"${HOME}/bin"':'"${PATH}"'"' >> ~/.bashrc
fi
export PATH="${PATH}" # basically useless
echo "setting path to: $PATH"
fi
echo "path is: $PATH"