setup.sh 676 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # setup.sh - Setup Go development software.
  3. PATH_CURRENT=`pwd`
  4. SETUP_ENV_SCRIPT_NAME=setup.sh
  5. # Find out the path of the setup script
  6. if [ $0 == $SETUP_ENV_SCRIPT_NAME ]; then
  7. PATH_SETUP_SH="."
  8. else
  9. PATH_SETUP_SH=${0/%\/$SETUP_ENV_SCRIPT_NAME}
  10. fi
  11. cd $PATH_SETUP_SH/..
  12. # Root dir of env-go
  13. ROOT_PATH=`pwd`
  14. # Define the paths
  15. TARGET_PATH=$ROOT_PATH/linux
  16. SOURCE_PATH=$ROOT_PATH/setup/pkg/linux
  17. # Extract files in place
  18. rm -fR $TARGET_PATH
  19. mkdir -p $TARGET_PATH
  20. cd $TARGET_PATH
  21. for filename in $SOURCE_PATH/*; do
  22. echo ${filename}
  23. echo ${filename: -7}
  24. if [ ${filename: -7} == ".tar.gz" ]; then
  25. tar -xvzf ${filename}
  26. fi
  27. done