Skip to content

Commit

Permalink
Merge branch 'xudafeng-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
hotoo committed Jul 13, 2015
2 parents 564cfca + 7a3acea commit d0daa78
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions bin/gitopen
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,27 @@ if (!options.scheme) {
//url = url.replace(/^https?/, options.protocol)

var url = GitRemote(options);
var shell;

if (commander.verbose) {
console.log('options:', options);
console.log(url);
console.log('Options:', options);
console.log('URL:', url);
}

if (process.platform === 'win32' || process.platform === 'win64') {
child_process.execSync('start ' + url);
} else { // darwin, unix, linux.
child_process.execSync('open ' + url);
switch(process.platform){
case 'win32':
case 'win64':
shell = 'start';
break;
case 'unix':
case 'linux':
shell = 'xdg-open';
break;
// case 'darwin':
default:
shell = 'open';
}

child_process.execSync(shell + ' ' + url);

// vim:ft=javascript

0 comments on commit d0daa78

Please sign in to comment.