swiftformat.sh 641 B

123456789101112131415161718192021222324
  1. #! /bin/sh
  2. # Check if the folder name is exactly "LoopFollow"
  3. FOLDER_NAME=$(basename "${SRCROOT}")
  4. if [ "${FOLDER_NAME}" != "LoopFollow" ]; then
  5. echo "Skipping swiftformat: This script only runs in the LoopFollow directory, not in '${FOLDER_NAME}'"
  6. exit 0
  7. fi
  8. function assertEnvironment {
  9. if [ -z $1 ]; then
  10. echo $2
  11. exit 127
  12. fi
  13. }
  14. assertEnvironment "${SRCROOT}" "Please set SRCROOT to project root folder"
  15. unset SDKROOT
  16. swift run -c release --package-path BuildTools swiftformat "${SRCROOT}" \
  17. --header "LoopFollow\n{file}" \
  18. --exclude Pods,Generated,R.generated.swift,fastlane/swift,Dependencies,dexcom-share-client-swift