@@ -18,7 +18,6 @@ use serde_json::{
1818 Value ,
1919} ;
2020use tokio:: fs;
21- use tracing:: debug;
2221
2322use crate :: os:: Os ;
2423use crate :: util:: paths:: GlobalPaths ;
@@ -40,10 +39,19 @@ pub struct MigrateArgs {
4039
4140impl MigrateArgs {
4241 pub async fn execute ( self , os : & mut Os ) -> Result < ExitCode > {
42+ // Try to acquire migration lock
43+ let _lock = match acquire_migration_lock ( ) ? {
44+ Some ( lock) => lock,
45+ None => {
46+ println ! ( "Migration already in progress by another process" ) ;
47+ return Ok ( ExitCode :: SUCCESS ) ;
48+ } ,
49+ } ;
50+
4351 let status = detect_migration ( os) . await ?;
4452
4553 if !self . force && matches ! ( status, MigrationStatus :: Completed ) {
46- debug ! ( "✓ Migration already completed" ) ;
54+ println ! ( "✓ Migration already completed" ) ;
4755 return Ok ( ExitCode :: SUCCESS ) ;
4856 }
4957
@@ -54,7 +62,7 @@ impl MigrateArgs {
5462 new_settings,
5563 } = status
5664 else {
57- debug ! ( "✓ No migration needed (fresh install)" ) ;
65+ println ! ( "✓ No migration needed (fresh install)" ) ;
5866 return Ok ( ExitCode :: SUCCESS ) ;
5967 } ;
6068
@@ -73,36 +81,27 @@ impl MigrateArgs {
7381 }
7482 }
7583
76- // Try to acquire migration lock
77- let _lock = match acquire_migration_lock ( ) ? {
78- Some ( lock) => lock,
79- None => {
80- debug ! ( "Migration already in progress by another process" ) ;
81- return Ok ( ExitCode :: SUCCESS ) ;
82- } ,
83- } ;
84-
8584 // Migrate database
8685 let db_result = migrate_database ( & old_db, & new_db, self . dry_run ) . await ?;
87- debug ! ( "✓ Database: {}" , db_result. message) ;
86+ println ! ( "✓ Database: {}" , db_result. message) ;
8887
8988 // Migrate settings
9089 let settings_result = migrate_settings ( & old_settings, & new_settings, self . dry_run ) . await ?;
91- debug ! ( "✓ Settings: {}" , settings_result. message) ;
90+ println ! ( "✓ Settings: {}" , settings_result. message) ;
9291 if !settings_result. transformations . is_empty ( ) {
93- debug ! ( " Transformations applied:" ) ;
92+ println ! ( " Transformations applied:" ) ;
9493 for t in & settings_result. transformations {
95- debug ! ( " - {t}" ) ;
94+ println ! ( " - {t}" ) ;
9695 }
9796 }
9897
9998 if !self . dry_run {
10099 os. database = crate :: database:: Database :: new ( ) . await ?;
101100 os. database . set_kiro_migration_completed ( ) ?;
102101
103- debug ! ( "\n ✓ Migration completed successfully!" ) ;
102+ println ! ( "\n ✓ Migration completed successfully!" ) ;
104103 } else {
105- debug ! ( "\n (Dry run - no changes made)" ) ;
104+ println ! ( "\n (Dry run - no changes made)" ) ;
106105 }
107106
108107 Ok ( ExitCode :: SUCCESS )
0 commit comments