home
·
contact
·
privacy
projects
/
config
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update w530 setup.
[config]
/
setup_go.sh
diff --git
a/setup_go.sh
b/setup_go.sh
index fabdce8d2e333049d7e69fa9b6d6830f21ec03e5..fc2f34490c43c13bb692f8b3e4333f2dfd43fe01 100755
(executable)
--- a/
setup_go.sh
+++ b/
setup_go.sh
@@
-3,12
+3,11
@@
set -e
set -x
set -e
set -x
+url=$1
+
ensure_line() {
add_string="$1"
file="$2"
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"
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
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
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
sudo tar -C /usr/local -xzf $filename
rm $filename
ensure_line 'export PATH=$PATH:/usr/local/go/bin' ~/.shinit_add