File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ function openBrowser(url) {
17
17
// Attempt to honor this environment variable.
18
18
// It is specific to the operating system.
19
19
// See https://github.com/sindresorhus/opn#app for documentation.
20
- const browser = process . env . BROWSER ;
20
+ let browser = process . env . BROWSER ;
21
21
22
22
// Special case: BROWSER="none" will prevent opening completely.
23
23
if ( browser === 'none' ) {
@@ -50,6 +50,14 @@ function openBrowser(url) {
50
50
}
51
51
}
52
52
53
+ // Another special case: on OS X, check if BROWSER has been set to "open".
54
+ // In this case, instead of passing `open` to `opn` (which won't work),
55
+ // just ignore it (thus ensuring the intended behavior, i.e. opening the system browser):
56
+ // https://github.com/facebookincubator/create-react-app/pull/1690#issuecomment-283518768
57
+ if ( process . platform === 'darwin' && browser === 'open' ) {
58
+ browser = undefined ;
59
+ }
60
+
53
61
// Fallback to opn
54
62
// (It will always open new tab)
55
63
try {
You can’t perform that action at this time.
0 commit comments