fix(migrate): skip autoMigrate when running migrate command

Prevents double migration message when user explicitly runs
'ccs migrate --dry-run' - autoMigrate was triggering real migration
before the migrate command handler ran.
This commit is contained in:
kaitranntt
2025-12-10 18:19:37 -05:00
parent 0d70708658
commit 05a6199d83
+5 -2
View File
@@ -203,8 +203,11 @@ async function main(): Promise<void> {
const args = process.argv.slice(2);
// Auto-migrate to unified config format (silent if already migrated)
const { autoMigrate } = await import('./config/migration-manager');
await autoMigrate();
// Skip if user is explicitly running migrate command
if (args[0] !== 'migrate') {
const { autoMigrate } = await import('./config/migration-manager');
await autoMigrate();
}
// Special case: version command (check BEFORE profile detection)
const firstArg = args[0];