Created
February 27, 2015 07:04
-
-
Save masonmark/e5e607b894ab4fe4dce3 to your computer and use it in GitHub Desktop.
Xcode Shell Script Build Phase for compiling CoffeeScript code during build
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export NODE_PATH=/usr/local/lib/node:/usr/local/lib/node_modules | |
export PATH=/usr/local/bin:$PATH | |
echo "Compiling .coffee assets..." | |
RESULT=`/usr/local/bin/coffee -c ${PROJECT_DIR}` | |
if [ $? -ne 0 ] | |
then | |
echo "The coffee command exited with non-zero exit status." | |
echo "$RESULT" | |
echo "Coffeescript compilation FAILED." | |
exit 5 | |
else | |
echo "The coffee command exited with success code." | |
fi | |
if [ "$RESULT" == "" ] | |
then | |
echo "The coffee command did not emit any warnings or errors." | |
echo "Coffeescript compilation completed." | |
else | |
echo "The coffee command emitted unexpected message(s):" | |
echo "$RESULT" | |
exit 4 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment