diff --git a/packages/cli/setup_env.bat b/packages/cli/setup_env.bat deleted file mode 100755 index 68318546b..000000000 --- a/packages/cli/setup_env.bat +++ /dev/null @@ -1,4 +0,0 @@ -:: Copyright (c) Facebook, Inc. and its affiliates. -:: -:: This source code is licensed under the MIT license found in the -:: LICENSE file in the root directory of this source tree. diff --git a/packages/cli/src/cliEntry.js b/packages/cli/src/cliEntry.js index 072c0e9c2..98d1c5cec 100644 --- a/packages/cli/src/cliEntry.js +++ b/packages/cli/src/cliEntry.js @@ -138,11 +138,24 @@ async function run() { } async function setupAndRun() { - const setupEnvScript = /^win/.test(process.platform) - ? path.join('..', 'setup_env.bat') - : path.join('..', 'setup_env.sh'); - - childProcess.execFileSync(path.join(__dirname, setupEnvScript)); + // We only have a setup script for UNIX envs currently + if (process.platform !== 'win32') { + const scriptName = 'setup_env.sh'; + const absolutePath = path.join(__dirname, '..', scriptName); + + try { + childProcess.execFileSync(absolutePath, { stdio: 'pipe' }); + } catch (error) { + logger.warn( + `Failed to run environment setup script "${scriptName}"\n\n${chalk.red( + error + )}` + ); + logger.info( + `React Native CLI will continue to run if your local environment matches what React Native expects. If it does fail, check out "${absolutePath}" and adjust your environment to match it.` + ); + } + } /** * Read passed `options` and take the "global" settings