BuildLoopFollow.sh 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. clear
  86. LOOP_BUILD=$(date +'%y%m%d-%H%M')
  87. LOOP_DIR=~/Downloads/BuildLoopFollow/$FOLDERNAME-$LOOP_BUILD
  88. mkdir ~/Downloads/BuildLoopFollow/
  89. mkdir $LOOP_DIR
  90. cd $LOOP_DIR
  91. pwd
  92. clear
  93. echo -e "\n\n Downloading Loop Follow to your Downloads folder.\n--------------------------------\n"
  94. git clone --branch=$BRANCH --recurse-submodules $REPO
  95. echo -e "--------------------------------\n\nIf there are no errors listed above, code has successfully downloaded.\n"
  96. echo -e "Type 1 and hit enter to open Xcode. You may close the terminal after Xcode opens\n\n"
  97. options=("Continue" "Cancel")
  98. select opt in "${options[@]}"
  99. do
  100. case $opt in
  101. "Continue")
  102. break
  103. ;;
  104. *)
  105. esac
  106. done
  107. cd LoopFollow
  108. Echo Open xcode
  109. xed ./LoopFollow.xcworkspace
  110. exit