File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ function openBrowser(url) {
1717 // Attempt to honor this environment variable.
1818 // It is specific to the operating system.
1919 // See https://github.com/sindresorhus/opn#app for documentation.
20- const browser = process . env . BROWSER ;
20+ let browser = process . env . BROWSER ;
2121
2222 // Special case: BROWSER="none" will prevent opening completely.
2323 if ( browser === 'none' ) {
@@ -50,6 +50,14 @@ function openBrowser(url) {
5050 }
5151 }
5252
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+
5361 // Fallback to opn
5462 // (It will always open new tab)
5563 try {
You can’t perform that action at this time.
0 commit comments