Skip to content

Instantly share code, notes, and snippets.

@jwietelmann
Forked from csampson/gist:5832198
Created June 21, 2013 16:00
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 jwietelmann/5832216 to your computer and use it in GitHub Desktop.
Save jwietelmann/5832216 to your computer and use it in GitHub Desktop.
var sys = require('child_process');
function commandExists(cmd) {
var exists = false;
sys.exec(cmd, function(err) {
if(err === null) // of maybe: if(!err instanceof Error)
exists = true;
});
return exists;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment