diff options
Diffstat (limited to 'lib/help.js')
-rw-r--r-- | lib/help.js | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/help.js b/lib/help.js index 495db8381..a8b1f2d4d 100644 --- a/lib/help.js +++ b/lib/help.js @@ -13,6 +13,7 @@ var fs = require("graceful-fs") , exec = require("./utils/exec.js") , npm = require("./npm.js") , log = require("npmlog") + , opener = require("opener") function help (args, cb) { var num = 1 @@ -63,18 +64,7 @@ function help (args, cb) { break case "browser": - var b = npm.config.get("browser") - if (!b) { - return cb(new Error("viewer=browser and no browser set.")) - } - console.log("Opening HTML in default browser...") - process.nextTick(cb) - // windows is SO weird. - if (process.platform === "win32") { - exec("cmd", ["/c", htmlPath], env, false, function () {}) - } else { - exec(b, [htmlPath], env, false, function () {}) - } + opener(htmlPath, { command: npm.config.get("browser") }, cb) break default: |