Skip to content

Instantly share code, notes, and snippets.

@asbestossupply
Last active December 21, 2015 16:59
Show Gist options
  • Save asbestossupply/6337448 to your computer and use it in GitHub Desktop.
Save asbestossupply/6337448 to your computer and use it in GitHub Desktop.
given the location of a coffeescript file this script will output the compiled js to the console with line numbers
#!/bin/bash
[ $# -eq 0 ] && { echo "Usage: $0 filename"; exit 999; }
# check for coffee
C=`which coffee`
[ -z $C ] && { echo "coffee not found"; exit -1; }
# check for awk
A=`which awk`
[ -z $A ] && { echo "awk not found"; exit -1; }
# DO IT
$C -p $1 | $A '{print FNR "\t" $0}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment