Skip to content

Commit

Permalink
defer to xdg-open on remaining platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
fixedset committed Apr 14, 2012
1 parent 13f42a0 commit ebaf74a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/open.js
@@ -1,4 +1,5 @@
var exec = require('child_process').exec;
var path = require('path');


/**
Expand All @@ -21,12 +22,12 @@ function open(target, callback) {
break;
default:
// use xdg open everywhere else
throw Error('Platform "' + process.platform + '" is not supported yet');
opener = path.join(__dirname, '../vendor/xdg-open');
break;
}

// TODO: what are the implications of quoting target?
// on windows things go wrong...
// on windows things go wrong...
// for instance 'start "http://www.google.com"' fails by opening a new
// instance of cmd.exe
return exec(opener + ' ' + target + '', callback);
Expand Down

0 comments on commit ebaf74a

Please sign in to comment.