Last active
August 29, 2015 14:18
-
-
Save catharinejm/932eedbd58d98f7eda2d to your computer and use it in GitHub Desktop.
Coffeescript Nave shim
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
#!/usr/bin/env zsh | |
set -e | |
function nave_version_file { | |
file="$(pwd)/.nave-version" | |
if [ -f "$file" ]; then | |
echo "$file" | |
elif `git rev-parse &>/dev/null`; then | |
file="$(git rev-parse --show-toplevel)/.nave-version" | |
if [ -f "$file" ]; then | |
echo "$file" | |
fi | |
fi | |
} | |
function nave_version { | |
file=$(nave_version_file) | |
if [[ "$file" ]]; then | |
head -n1 $(nave_version_file) | |
fi | |
} | |
if [ -z "$NAVE" ]; then | |
version=$(nave_version) | |
if [[ "$version" ]]; then | |
exec nave use "$version" coffee "$@" | |
fi | |
echo 'no nave version!' >&2 | |
exit 1 | |
fi | |
exec "$NAVEPATH/coffee" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment