-
-
Save tanepiper/f888aa55079ed83e8e2a 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 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