Skip to content

Commit a98337c

Browse files
jamesgeorge007mrmckeb
authored andcommitted
Replace opn with open (#7058)
The `opn` package has been deprecated, replaced by `open`.
1 parent bdaccf7 commit a98337c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/react-dev-utils/openBrowser.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
var chalk = require('chalk');
1111
var execSync = require('child_process').execSync;
1212
var spawn = require('cross-spawn');
13-
var opn = require('opn');
13+
var open = require('open');
1414

15-
// https://github.com/sindresorhus/opn#app
15+
// https://github.com/sindresorhus/open#app
1616
var OSX_CHROME = 'google chrome';
1717

1818
const Actions = Object.freeze({
@@ -24,7 +24,7 @@ const Actions = Object.freeze({
2424
function getBrowserEnv() {
2525
// Attempt to honor this environment variable.
2626
// It is specific to the operating system.
27-
// See https://github.com/sindresorhus/opn#app for documentation.
27+
// See https://github.com/sindresorhus/open#app for documentation.
2828
const value = process.env.BROWSER;
2929
let action;
3030
if (!value) {
@@ -93,11 +93,11 @@ function startBrowserProcess(browser, url) {
9393
browser = undefined;
9494
}
9595

96-
// Fallback to opn
96+
// Fallback to open
9797
// (It will always open new tab)
9898
try {
9999
var options = { app: browser, wait: false };
100-
opn(url, options).catch(() => {}); // Prevent `unhandledRejection` error.
100+
open(url, options).catch(() => {}); // Prevent `unhandledRejection` error.
101101
return true;
102102
} catch (err) {
103103
return false;

packages/react-dev-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"inquirer": "6.2.2",
6868
"is-root": "2.0.0",
6969
"loader-utils": "1.2.3",
70-
"opn": "5.4.0",
70+
"open": "^6.3.0",
7171
"pkg-up": "2.0.0",
7272
"react-error-overlay": "^5.1.6",
7373
"recursive-readdir": "2.2.2",

0 commit comments

Comments
 (0)