Created
January 18, 2016 16:54
-
-
Save jmervine/87b20bd99dba7a09cde9 to your computer and use it in GitHub Desktop.
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
var assert = require('assert'); | |
var exec = require('child_process').execFileSync; | |
// execFileSync throw an error if it returns a non-zero exit status | |
assert(exec('./index.js')); | |
/* | |
For the above to work index.js needs: | |
1. to be executable (i.e. 0755) | |
2. it's first line to contain `#!/usr/bin/env node` | |
Otherwise, you would want something like: | |
assert(exec('/usr/bin/node', ['./index.js'])); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment