X-Git-Url: https://plomlompom.com/repos/?p=config;a=blobdiff_plain;f=setup_go.sh;h=fc2f34490c43c13bb692f8b3e4333f2dfd43fe01;hp=fabdce8d2e333049d7e69fa9b6d6830f21ec03e5;hb=HEAD;hpb=18bb8421ac5593f7b40e15937cb3a66345bf2fca 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