Skip to content

Instantly share code, notes, and snippets.

@masonmark
Created February 27, 2015 07:04
Show Gist options
  • Save masonmark/e5e607b894ab4fe4dce3 to your computer and use it in GitHub Desktop.
Save masonmark/e5e607b894ab4fe4dce3 to your computer and use it in GitHub Desktop.
Xcode Shell Script Build Phase for compiling CoffeeScript code during build
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