Skip to content

Instantly share code, notes, and snippets.

@tanepiper
Created September 2, 2012 11:46
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 tanepiper/f888aa55079ed83e8e2a to your computer and use it in GitHub Desktop.
Save tanepiper/f888aa55079ed83e8e2a to your computer and use it in GitHub Desktop.
var start = function(path, options, extra, callback) {
fs.exists(path, function(exists) {
if (!exists) {
return cb(new Error('File ' + path + 'does not exist'));
}
if (typeof extra === 'function') {
callback = extra;
extras = [];
} else if (typeof options === 'function') {
callback = options;
extras = [];
options = {};
}
var exec_options = [];
var key;
for (key in options) {
exec_options.push(key);
exec_options.push(options[key]);
}
exec_options.push(path);
exec_options.concat(extra);
command('vmrun ' + exec_options.join(' '), callback);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment