Skip to content

Instantly share code, notes, and snippets.

@micheltlutz
Created November 8, 2022 00:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micheltlutz/79d1ca330a7a128bc5e7769613532466 to your computer and use it in GitHub Desktop.
Save micheltlutz/79d1ca330a7a128bc5e7769613532466 to your computer and use it in GitHub Desktop.
Exemplo de arquivo pre-commit
#!/bin/bash
message=""
#----------------------------------------------------------------
# BUILD XCODE PROJECT & VALIDATE
#----------------------------------------------------------------
xcodebuild test -workspace MicroappArcExample.xcworkspace -scheme MicroappArcExample -sdk iphonesimulator -destination 'platform=iOS Simulator,OS=16.1,name=iPhone 14'
if test $? -eq 0
then echo -e "\033[1;32mOK: [Policy][✅] Passed build and unit tests.\033[0m" && exit 0
else
message="[Policy][❌] Passed build or unit tests."
echo -e "\033[1;31mERROR: $message\033[0m";
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment