|
@@ -0,0 +1,39 @@
|
|
|
|
+#!/bin/bash
|
|
|
|
+
|
|
|
|
+# setup.sh - Setup Go development software.
|
|
|
|
+
|
|
|
|
+PATH_CURRENT=`pwd`
|
|
|
|
+SETUP_ENV_SCRIPT_NAME=setup.sh
|
|
|
|
+
|
|
|
|
+# Find out the path of the setup script
|
|
|
|
+
|
|
|
|
+if [ $0 == $SETUP_ENV_SCRIPT_NAME ]; then
|
|
|
|
+ PATH_SETUP_SH="."
|
|
|
|
+else
|
|
|
|
+ PATH_SETUP_SH=${0/%\/$SETUP_ENV_SCRIPT_NAME}
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+cd $PATH_SETUP_SH/..
|
|
|
|
+
|
|
|
|
+# Root dir of env-go
|
|
|
|
+
|
|
|
|
+ROOT_PATH=`pwd`
|
|
|
|
+
|
|
|
|
+# Define the paths
|
|
|
|
+
|
|
|
|
+TARGET_PATH=$ROOT_PATH/linux
|
|
|
|
+SOURCE_PATH=$ROOT_PATH/setup/pkg/linux
|
|
|
|
+
|
|
|
|
+# Extract files in place
|
|
|
|
+
|
|
|
|
+rm -fR $TARGET_PATH
|
|
|
|
+mkdir -p $TARGET_PATH
|
|
|
|
+
|
|
|
|
+cd $TARGET_PATH
|
|
|
|
+for filename in $SOURCE_PATH/*; do
|
|
|
|
+ echo ${filename}
|
|
|
|
+ echo ${filename: -7}
|
|
|
|
+ if [ ${filename: -7} == ".tar.gz" ]; then
|
|
|
|
+ tar -xvzf ${filename}
|
|
|
|
+ fi
|
|
|
|
+done
|