Replace opn with open (#7058)

The `opn` package has been deprecated, replaced by `open`.
This commit is contained in:
James George
2019-05-21 13:53:04 +05:30
committed by Brody McKee
parent bdaccf7161
commit a98337c257
2 changed files with 6 additions and 6 deletions

View File

@@ -10,9 +10,9 @@
var chalk = require('chalk');
var execSync = require('child_process').execSync;
var spawn = require('cross-spawn');
var opn = require('opn');
var open = require('open');
// https://github.com/sindresorhus/opn#app
// https://github.com/sindresorhus/open#app
var OSX_CHROME = 'google chrome';
const Actions = Object.freeze({
@@ -24,7 +24,7 @@ const Actions = Object.freeze({
function getBrowserEnv() {
// Attempt to honor this environment variable.
// It is specific to the operating system.
// See https://github.com/sindresorhus/opn#app for documentation.
// See https://github.com/sindresorhus/open#app for documentation.
const value = process.env.BROWSER;
let action;
if (!value) {
@@ -93,11 +93,11 @@ function startBrowserProcess(browser, url) {
browser = undefined;
}
// Fallback to opn
// Fallback to open
// (It will always open new tab)
try {
var options = { app: browser, wait: false };
opn(url, options).catch(() => {}); // Prevent `unhandledRejection` error.
open(url, options).catch(() => {}); // Prevent `unhandledRejection` error.
return true;
} catch (err) {
return false;

View File

@@ -67,7 +67,7 @@
"inquirer": "6.2.2",
"is-root": "2.0.0",
"loader-utils": "1.2.3",
"opn": "5.4.0",
"open": "^6.3.0",
"pkg-up": "2.0.0",
"react-error-overlay": "^5.1.6",
"recursive-readdir": "2.2.2",