X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;ds=sidebyside;f=setup_go.sh;h=fc2f34490c43c13bb692f8b3e4333f2dfd43fe01;hb=dbe3da5f426402da87a924a05057ce8a3214ce0a;hp=fabdce8d2e333049d7e69fa9b6d6830f21ec03e5;hpb=18bb8421ac5593f7b40e15937cb3a66345bf2fca;p=config
diff --git a/setup_go.sh b/setup_go.sh
index fabdce8..fc2f344 100755
--- a/setup_go.sh
+++ b/setup_go.sh
@@ -3,12 +3,11 @@
set -e
set -x
+url=$1
+
ensure_line() {
add_string="$1"
file="$2"
- echo "TESTESTEST"
- echo $add_string
- echo $file
test=`grep "$add_string" "$file" | wc -l`
if [ $test -lt 1 ]; then
echo "$add_string" >> "$file"
@@ -17,13 +16,13 @@ ensure_line() {
filename=temp_golang_binary
-if [ "$1" = "" ]; then
+if [ "$url" = "" ]; then
echo 'Need URL of current go package'
exit 1
fi
sudo rm -rf /usr/local/go
sudo apt-get -y install wget
-wget -O $filename $1
+wget -O $filename $url
sudo tar -C /usr/local -xzf $filename
rm $filename
ensure_line 'export PATH=$PATH:/usr/local/go/bin' ~/.shinit_add