BuildLoopFollow.sh 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. # !/bin/bash
  2. RED='\033[0;31m'
  3. GREEN='\033[0;32m'
  4. PURPLE='\033[0;35m'
  5. BOLD='\033[1m'
  6. NC='\033[0m'
  7. REPO=https://github.com/jonfawcett/LoopFollow
  8. clear
  9. echo -e "\n\n--------------------------------\n\nWelcome to Loop Follow. This script will assist you in downloading and building the app. Before you begin, please ensure that you have Xcode installed and your phone is plugged into your computer\n\n--------------------------------\n\n"
  10. echo -e "Type 1 and hit enter to begin.\nType 2 and hit enter to cancel."
  11. options=("Continue" "Cancel")
  12. select opt in "${options[@]}"
  13. do
  14. case $opt in
  15. "Continue")
  16. break
  17. ;;
  18. "Cancel")
  19. echo -e "\n${RED}User cancelled!${NC}";
  20. exit 0
  21. break
  22. ;;
  23. *)
  24. esac
  25. done
  26. clear
  27. echo -e "Please select which version of Loop Follow you would like to download and build. Dev branch has the latest features but may contain more bugs.\n\nType the number 1 or 2 and hit enter to select the branch.\nType 3 and hit enter to cancel.\n\n"
  28. options=("Main Branch" "Dev Branch" "Cancel")
  29. select opt in "${options[@]}"
  30. do
  31. case $opt in
  32. "Main Branch")
  33. FOLDERNAME=LoopFollow-Main
  34. BRANCH=Main
  35. break
  36. ;;
  37. "Dev Branch")
  38. FOLDERNAME=LoopFollow-Dev
  39. BRANCH=dev
  40. break
  41. ;;
  42. "Cancel")
  43. echo -e "\n${RED}User cancelled!${NC}";
  44. exit 0
  45. break
  46. ;;
  47. *)
  48. esac
  49. done
  50. clear
  51. echo -e "Would you like to delete prior downloads of Loop Follow before proceeding?\n\n"
  52. echo -e "Type 1 and hit enter to delete.\nType 2 and hit enter to continue without deleting.\n\n"
  53. options=("Delete old downloads" "Do not delete old downloads")
  54. select opt in "${options[@]}"
  55. do
  56. case $opt in
  57. "Delete old downloads")
  58. rm -rf ~/Downloads/BuildLoopFollow/*
  59. break
  60. ;;
  61. "Do not delete old downloads")
  62. break
  63. ;;
  64. *)
  65. esac
  66. done
  67. clear
  68. echo -e "The code will now begin downloading. The files will be saved in your Downloads folder and Xcode will automatically open when the download is complete.\n\n"
  69. echo -e "Type 1 and hit enter to begin downloading.\nType 2 and hit enter to cancel.\n\n"
  70. options=("Continue" "Cancel")
  71. select opt in "${options[@]}"
  72. do
  73. case $opt in
  74. "Continue")
  75. break
  76. ;;
  77. "Cancel")
  78. echo -e "\n${RED}User cancelled!${NC}";
  79. exit 0
  80. break
  81. ;;
  82. *)
  83. esac
  84. done
  85. Echo Set environment variables
  86. LOOP_BUILD=$(date +'%y%m%d-%H%M')
  87. LOOP_DIR=~/Downloads/BuildLoopFollow/$FOLDERNAME-$LOOP_BUILD
  88. Echo make directories using format year month date hour minute so it can be easily sorted
  89. mkdir ~/Downloads/BuildLoopFollow/
  90. mkdir $LOOP_DIR
  91. cd $LOOP_DIR
  92. pwd
  93. Echo download software from github
  94. git clone --branch=$BRANCH --recurse-submodules $REPO
  95. cd LoopFollow
  96. Echo Open xcode
  97. xed .
  98. exit