Skip to content

Commit

Permalink
fix experience with validating metro config in non-interactive mode (#…
Browse files Browse the repository at this point in the history
…644)

* fix experience with validating metro config in non-interactive mode

* update CHANGELOG
  • Loading branch information
dsokal authored Sep 24, 2021
1 parent 0bce278 commit fe0a3b4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
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

0 comments on commit fe0a3b4

Please sign in to comment.