pulsar/script/compile-coffee
Adam Roben 73e0b72479 Only source /opt/github/env.sh if needed
If node is already in PATH and functional, we don't need to spend a
bunch of time running all of Boxen's setup scripts.

This reduces clean build time on my MacBook Pro from 46 seconds to 31
seconds.
2013-03-04 11:52:51 -05:00

15 lines
387 B
Bash
Executable File

#!/bin/sh
set -e
# Because of the way xcodebuild invokes external scripts we need to load
# The Setup's environment ourselves. If this isn't done, things like the
# node shim won't be able to find the stuff they need.
node --version > /dev/null 2>&1 || source /opt/github/env.sh
INPUT_FILE="${1}"
OUTPUT_FILE="${2}"
node_modules/.bin/coffee -c -p "${INPUT_FILE}" > "${OUTPUT_FILE}"