Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix experience with validating metro config in non-interactive mode #644

Merged
merged 2 commits into from
Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 13 additions & 3 deletions packages/eas-cli/src/project/metroConfig.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
}
}
}
Expand Down