build-dependencies.sh 640 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. function build_dependencies {
  3. has_dependencies=$(ls Carthage/Build/**/*.framework 2> /dev/null | wc -l)
  4. if [ $has_dependencies != 0 ]
  5. then
  6. echo "Depencies have already been built."
  7. else
  8. echo "Building dependencies..."
  9. carthage bootstrap
  10. fi
  11. }
  12. function alert_to_install_carthage {
  13. echo "error: Carthage was not found! In order to build Charts you need to use Carthage to build its dependencies. Carthage can be downloaded from https://github.com/Carthage/Carthage."
  14. exit 1
  15. }
  16. if hash carthage 2>/dev/null
  17. then
  18. build_dependencies
  19. else
  20. alert_to_install_carthage
  21. fi