Skip to content

Commit

Permalink
Correct browser auto-launching in gulp file
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJaredWilcurt committed Oct 6, 2016
1 parent 981383c commit 798155b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ gulp.task('watch', function () {
gulp.task('open', function () {
var url = 'http://localhost:8000';
var OS = process.platform;
var exectuable = '';
var executable = '';

//OS Specific values for opening files.
if (OS == 'darwin') { executable = 'open '; }
if (OS == 'linux') { executable = 'xdg-open '; }
if (OS == 'win32') { exectuable = 'explorer '; }
if (OS == 'darwin') { executable = 'open "' + url + '"'; }
if (OS == 'linux') { executable = 'xdg-open ' + url; }
if (OS == 'win32') { executable = 'explorer ' + url; }

//Run the OS specific command to open the url in the default browser
require("child_process").exec( exectuable + url );
require('child_process').exec(executable);
});

// The default Gulp task that happens when you run gulp.
Expand Down

0 comments on commit 798155b

Please sign in to comment.