MCPcopy Index your code
hub / github.com/react/create-react-app / getBrowserEnv

Function getBrowserEnv

packages/react-dev-utils/openBrowser.js:24–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22});
23
24function getBrowserEnv() {
25 // Attempt to honor this environment variable.
26 // It is specific to the operating system.
27 // See https://github.com/sindresorhus/open#app for documentation.
28 const value = process.env.BROWSER;
29 const args = process.env.BROWSER_ARGS
30 ? process.env.BROWSER_ARGS.split(' ')
31 : [];
32 let action;
33 if (!value) {
34 // Default.
35 action = Actions.BROWSER;
36 } else if (value.toLowerCase().endsWith('.js')) {
37 action = Actions.SCRIPT;
38 } else if (value.toLowerCase() === 'none') {
39 action = Actions.NONE;
40 } else {
41 action = Actions.BROWSER;
42 }
43 return { action, value, args };
44}
45
46function executeNodeScript(scriptPath, url) {
47 const extraArgs = process.argv.slice(2);

Callers 1

openBrowserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected