Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support options.command #5

Merged
merged 2 commits into from Sep 13, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions opener.js
Expand Up @@ -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
Expand Down