Skip to content

Commit

Permalink
Merge pull request #18303 from storybookjs/fix/automigration-texts
Browse files Browse the repository at this point in the history
CLI: Improve texts for automigration
  • Loading branch information
shilman committed May 24, 2022
1 parent 8342c3a commit cc114d5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/cli/src/automigrate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ export const automigrate = async ({ fixId, dryRun, yes }: FixOptions = {}) => {
const packageManager = JsPackageManagerFactory.getPackageManager();
const filtered = fixId ? fixes.filter((f) => f.id === fixId) : fixes;

logger.info('🔎 checking possible migrations..');

for (let i = 0; i < filtered.length; i += 1) {
const f = fixes[i] as Fix;
logger.info(`🔎 checking '${chalk.cyan(f.id)}'`);
const result = await f.check({ packageManager });
if (result) {
logger.info(`🔎 found a '${chalk.cyan(f.id)}' migration:`);
logger.info();
const message = f.prompt(result);

logger.info(
Expand All @@ -39,7 +42,7 @@ export const automigrate = async ({ fixId, dryRun, yes }: FixOptions = {}) => {
runAnswer = await prompts({
type: 'confirm',
name: 'fix',
message: `Do you want to run the '${chalk.cyan(f.id)}' fix on your project?`,
message: `Do you want to run the '${chalk.cyan(f.id)}' migration on your project?`,
});
}

Expand All @@ -61,4 +64,8 @@ export const automigrate = async ({ fixId, dryRun, yes }: FixOptions = {}) => {
}
}
}

logger.info();
logger.info('✅ migration check successfully ran');
logger.info();
};

0 comments on commit cc114d5

Please sign in to comment.