diff --git a/CHANGELOG.md b/CHANGELOG.md index 22aadc1a05..794040dc83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ This is the log of notable changes to EAS CLI and related packages. ### ๐Ÿ› Bug fixes +- Don't display prompt in non-interactive mode when the metro config seems invalid. ([#644](https://github.com/expo/eas-cli/pull/644) by [@dsokal](https://github.com/dsokal)) + ### ๐Ÿงน Chores ## [0.28.2](https://github.com/expo/eas-cli/releases/tag/v0.28.2) - 2021-09-23 diff --git a/packages/eas-cli/src/project/metroConfig.ts b/packages/eas-cli/src/project/metroConfig.ts index a12a660ed3..7ad7ae55a1 100644 --- a/packages/eas-cli/src/project/metroConfig.ts +++ b/packages/eas-cli/src/project/metroConfig.ts @@ -1,4 +1,5 @@ import { Platform } from '@expo/eas-build-job'; +import { exit } from '@oclif/errors'; import chalk from 'chalk'; import type MetroConfig from 'metro-config'; import resolveFrom from 'resolve-from'; @@ -27,19 +28,28 @@ export async function validateMetroConfigForManagedWorkflowAsync( Log.warn( 'This can result in unexpected and hard to debug issues, like missing assets in the production bundle.' ); - Log.warn(`We recommend you to abort, fix the ${chalk.bold('metro.config.js')}, and try again.`); + if (!ctx.nonInteractive) { + Log.warn( + `We recommend you to abort, fix the ${chalk.bold('metro.config.js')}, and try again.` + ); + } Log.warn( learnMore('https://docs.expo.dev/guides/customizing-metro/', { learnMoreMessage: 'Learn more on customizing Metro', }) ); + if (ctx.nonInteractive) { + Log.warn("You've run EAS CLI in non-interactive mode, proceeding..."); + return; + } + const shouldAbort = await confirmAsync({ message: 'Would you like to abort?', }); if (shouldAbort) { - Log.log('Aborting...'); - process.exit(1); + Log.error('Aborting...'); + exit(1); } } }