X-Git-Url: https://plomlompom.com/repos/index.html?a=blobdiff_plain;f=setup_go.sh;h=fc2f34490c43c13bb692f8b3e4333f2dfd43fe01;hb=53ac7fcda43e961e1d756b1bb93ccd34a1ab07cb;hp=4d255f8f58cfef0fa5bc93b87df3cbaefdde1f19;hpb=79dc5d5f6bb316807da0604147f89ff410ab5b5c;p=config
diff --git a/setup_go.sh b/setup_go.sh
index 4d255f8..fc2f344 100755
--- a/setup_go.sh
+++ b/setup_go.sh
@@ -3,6 +3,8 @@
set -e
set -x
+url=$1
+
ensure_line() {
add_string="$1"
file="$2"
@@ -14,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