Skip to content

Instantly share code, notes, and snippets.

@hildjj
Created September 13, 2016 19:04
Show Gist options
  • Save hildjj/9d0ff5a1c3638656fbcfb0e09c3df72e to your computer and use it in GitHub Desktop.
Save hildjj/9d0ff5a1c3638656fbcfb0e09c3df72e to your computer and use it in GitHub Desktop.
Make coffeescript that has been compiled to javascript run as shebang
#!/usr/bin/env coffee
`#!/usr/bin/env node
`
# The extra newline in the backticks is crucial.
# It keeps the semicolon that coffee-script adds from messing up the shebang.
# now compile with "coffee -bcs --no-header < foo.coffee > bin/foo"
# -b: bare
# -c: compile
# -s: stdio
# --noheader: don't output version comment at the top
@hildjj
Copy link
Author

hildjj commented Sep 13, 2016

Also: remember to chmod +x bin/foo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment