Support options.command #5

Merged
merged 2 commits into from Sep 13, 2012
Jump to file
+14 −0
Split
View
@@ -14,6 +14,20 @@ function opener(args, options, callback) {
args = [args];
}
+ if (typeof options === "function") {
+ callback = options;
+ options = {};
+ }
+
+ if (options && typeof options === "object" && options.command) {
+ if (process.platform === "win32") {
+ // *always* use cmd on windows
+ args = [options.command].concat(args);
+ } else {
+ cmd = options.command;
+ }
+ }
+
if (process.platform === "win32") {
// On Windows, we really want to use the "start" command. But, the rules regarding arguments with spaces, and
// escaping them with quotes, can get really arcane. So the easiest way to deal with this is to pass off the