Skip to content

Instantly share code, notes, and snippets.

@olih
Forked from aral/coffeetojson.sh
Last active December 16, 2015 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olih/5502956 to your computer and use it in GitHub Desktop.
Save olih/5502956 to your computer and use it in GitHub Desktop.
Converts a coffee-json file to json as an alias. Requires node.js and coffeescript.
#On MacOS, adds this to your .bash_profile
function json { coffee --print --bare $1.coffee | sed '1s/&.//' | sed 's/});/}/' | sed 's/({/{/' | sed "s/\([^ '\"].*[^ '\"]\): /\"\1\": /1" > $1.json ;}
export -f json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment