Skip to content

Commit

Permalink
fix: Fix browser window openning issues
Browse files Browse the repository at this point in the history
Fixes #482
  • Loading branch information
medikoo committed Aug 27, 2020
1 parent 973f14a commit bb95b8b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/login.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use strict';

const { ServerlessSDK } = require('@serverless/platform-client');
const { urls, readConfigFile, writeConfigFile, openBrowser } = require('@serverless/platform-sdk');
const { urls, readConfigFile, writeConfigFile } = require('@serverless/platform-sdk');
const open = require('open');

module.exports = async function (ctx) {
ctx.sls.cli.log('Logging you in via your default browser...');
Expand All @@ -14,7 +15,7 @@ module.exports = async function (ctx) {

const { loginUrl, loginData: loginDataDeferred } = await sdk.login(loginConfig);

openBrowser(loginUrl);
open(loginUrl);

const loginData = await loginDataDeferred;

Expand Down
4 changes: 2 additions & 2 deletions lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ const _ = require('lodash');
const updateNotifier = require('update-notifier');
const {
configureFetchDefaults,
openBrowser,
getAccessKeyForTenant,
getMetadata,
} = require('@serverless/platform-sdk');
const open = require('open');
const sfePkgJson = require('../package');
const errorHandler = require('./errorHandler');
const logsCollection = require('./logsCollection');
Expand Down Expand Up @@ -471,7 +471,7 @@ class ServerlessEnterprisePlugin {
);
break;
case 'dashboard:dashboard':
openBrowser(getDashboardUrl(this));
open(getDashboardUrl(this));
break;
case 'before:logs:logs':
await getCredentials(this);
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"ncjsm": "^4.1.0",
"node-dir": "^0.1.17",
"node-fetch": "^2.6.0",
"open": "^7.2.0",
"semver": "^6.3.0",
"simple-git": "^1.132.0",
"update-notifier": "^2.5.0",
Expand Down

0 comments on commit bb95b8b

Please sign in to comment.