Skip to content

Commit

Permalink
Replace opn with open (#7058)
Browse files Browse the repository at this point in the history
The `opn` package has been deprecated, replaced by `open`.
  • Loading branch information
jamesgeorge007 authored and mrmckeb committed May 21, 2019
1 parent bdaccf7 commit a98337c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions packages/react-dev-utils/openBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

1 comment on commit a98337c

@faisalraza
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.