Skip to content

Commit c09cc35

Browse files
committed
style(migrate): use boxed UI for migration success message
1 parent 05a6199 commit c09cc35

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

src/commands/migrate-command.ts

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,38 +61,35 @@ export async function handleMigrateCommand(args: string[]): Promise<void> {
6161
console.log('');
6262
}
6363

64-
console.log('[i] Migrating to unified config format (v2)...');
65-
console.log('');
66-
6764
const result = await migrate(dryRun);
6865

6966
if (result.success) {
70-
console.log('[OK] Migration complete');
7167
console.log('');
72-
73-
if (result.backupPath) {
74-
console.log(` Backup created: ${result.backupPath}`);
68+
console.log('╭─────────────────────────────────────────────────────────╮');
69+
if (dryRun) {
70+
console.log('│ [i] Dry run - migration preview (no changes made) │');
71+
} else {
72+
console.log('│ [OK] Migrated to unified config (config.yaml) │');
7573
}
74+
console.log('╰─────────────────────────────────────────────────────────╯');
7675

77-
if (result.migratedFiles.length > 0) {
78-
console.log('');
79-
console.log(' Migrated:');
80-
result.migratedFiles.forEach((f) => console.log(` - ${f}`));
76+
if (result.backupPath && !dryRun) {
77+
console.log(` Backup: ${result.backupPath}`);
8178
}
79+
console.log(` Items: ${result.migratedFiles.length} migrated`);
8280

8381
if (result.warnings.length > 0) {
84-
console.log('');
85-
console.log(' Warnings:');
86-
result.warnings.forEach((w) => console.log(` [!] ${w}`));
82+
for (const warning of result.warnings) {
83+
console.log(` [!] ${warning}`);
84+
}
8785
}
8886

8987
if (dryRun) {
90-
console.log('');
91-
console.log('[i] This was a dry run. Run without --dry-run to apply changes.');
88+
console.log(' Run without --dry-run to apply changes');
9289
} else {
93-
console.log('');
94-
console.log('[i] To rollback: ccs migrate --rollback ' + result.backupPath);
90+
console.log(' Rollback: ccs migrate --rollback');
9591
}
92+
console.log('');
9693
} else {
9794
console.error(`[X] Migration failed: ${result.error}`);
9895

0 commit comments

Comments
 (0)