update.ios.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. eros_prefix="[\033[34meros\033[0m]"
  3. function error_exit {
  4. echo "--------------------------------------------"
  5. echo -e "\033[31m Error code is $1 \033[0m" 1>&2
  6. echo ""
  7. echo " Code tips: "
  8. echo -e "\033[33m1 -> platforms/ios/WeexEros/ is not existed. \033[0m"
  9. echo -e "\033[33m2 -> cannot git pull platforms/ios/WeexEros/WeexiOSSDK, you can try a manual operation. \033[0m"
  10. echo -e "\033[33m3 -> cannot git pull platforms/ios/WeexEros/Benmu-iOS-Library, you can try a manual operation. \033[0m"
  11. echo -e "\033[33m4 -> pod update failed. \033[0m"
  12. echo -e "\033[33m5 -> run open xcode failed, make sure you had install xcode in appStore. \033[0m"
  13. exit 1
  14. }
  15. cd platforms/ios/WeexEros/ || \
  16. error_exit 1
  17. echo -e "$eros_prefix \033[33m tips: make sure xcode had been closed.\033[0m"
  18. echo -e "$eros_prefix Enter ios project"
  19. if [ -e WeexiOSSDK/ ] && [ -e Benmu-iOS-Library/ ]
  20. then
  21. echo -e "$eros_prefix Start to updating."
  22. cd WeexiOSSDK/ && git pull || error_exit 2
  23. cd ../Benmu-iOS-Library/ && git pull || error_exit 3
  24. cd ..
  25. echo -e "$eros_prefix Run pod update and show some update detail:"
  26. pod update --no-ansi || error_exit 4
  27. echo -e "$eros_prefix \033[32miOS sdk has been updated, enjoy it! \033[0m"
  28. open WeexEros.xcworkspace || error_exit 5
  29. else
  30. echo -e "$eros_prefix No WeexiOSSDK or Benmu-iOS-Library file, make sure you had been run eros install."
  31. fi