Skip to content

Instantly share code, notes, and snippets.

@STRd6
Created June 27, 2013 18:34
Show Gist options
  • Select an option

  • Save STRd6/5879115 to your computer and use it in GitHub Desktop.

Select an option

Save STRd6/5879115 to your computer and use it in GitHub Desktop.
Like Rake's sh
{print} = require('sys')
{exec} = require('child_process')
sh = (cmd, fn=->) ->
print cmd
exec cmd, (error, stdout, stderr) ->
print(stdout)
if error
print(stderr)
process.exit(1)
fn()
module.exports = sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment