Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Commit

Permalink
fix(serve): Fix for browser not opening on linux, fixes #425 (#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcorosi authored and danbucholtz committed Apr 21, 2017
1 parent a8616eb commit 77edbc6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ function onReady(config: ServeConfig, context: BuildContext) {
.concat(browserOption(context) ? [browserOption(context)] : [])
.concat(platformOption(context) ? ['?ionicplatform=', platformOption(context)] : []);

open(openOptions.join(''), browserToLaunch(context));
open(openOptions.join(''), browserToLaunch(context),(error:any) => {
if (error) {
Logger.warn(`Sorry.. unable to open the browser for you: ${error}`);
}
});
}
Logger.info(`dev server running: ${config.hostBaseUrl}/`, 'green', true);
Logger.newLine();
Expand Down
4 changes: 2 additions & 2 deletions src/util/open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export default function (target: string, appName: string | Function, callback?:
if (typeof appName === 'string') {
opener = escape(appName);
} else {
// use Portlands xdg-open everywhere else
opener = path.join(__dirname, '../vendor/xdg-open');
//use system installed Portlands xdg-open everywhere else
opener = 'xdg-open';
}
break;
}
Expand Down

0 comments on commit 77edbc6

Please sign in to comment.