@@ -231,7 +231,10 @@ fn find_hx_files(project_dir: &Path) -> Result<Vec<PathBuf>> {
231231 let entry = entry?;
232232 let path = entry. path ( ) ;
233233
234- if let Some ( extension) = path. extension ( ) && extension == "hx" && path. file_name ( ) != Some ( "schema.hx" . as_ref ( ) ) {
234+ if let Some ( extension) = path. extension ( )
235+ && extension == "hx"
236+ && path. file_name ( ) != Some ( "schema.hx" . as_ref ( ) )
237+ {
235238 hx_files. push ( path) ;
236239 }
237240 }
@@ -274,18 +277,28 @@ fn show_migration_plan(ctx: &MigrationContext) -> Result<()> {
274277
275278 print_newline ( ) ;
276279 print_header ( "🏠 Home Directory Migration:" ) ;
277- let home_dir = dirs:: home_dir ( ) . ok_or_else ( || CliError :: new ( "Could not find home directory" ) ) ?;
280+ let home_dir =
281+ dirs:: home_dir ( ) . ok_or_else ( || CliError :: new ( "Could not find home directory" ) ) ?;
278282 let v1_helix_dir = home_dir. join ( ".helix" ) ;
279283 if v1_helix_dir. exists ( ) {
280284 let v2_marker = v1_helix_dir. join ( ".v2" ) ;
281285 if v2_marker. exists ( ) {
282- print_field ( "Already migrated" , "~/.helix directory already migrated to v2" ) ;
286+ print_field (
287+ "Already migrated" ,
288+ "~/.helix directory already migrated to v2" ,
289+ ) ;
283290 } else {
284291 print_field ( "Create backup" , "~/.helix → ~/.helix-v1-backup" ) ;
285292 if v1_helix_dir. join ( "dockerdev" ) . exists ( ) {
286- print_field ( "Clean up Docker" , "Stop/remove helix-dockerdev containers and images" ) ;
293+ print_field (
294+ "Clean up Docker" ,
295+ "Stop/remove helix-dockerdev containers and images" ,
296+ ) ;
287297 }
288- print_field ( "Clean directory" , "Remove all except ~/.helix/credentials and ~/.helix/repo" ) ;
298+ print_field (
299+ "Clean directory" ,
300+ "Remove all except ~/.helix/credentials and ~/.helix/repo" ,
301+ ) ;
289302 if v1_helix_dir. join ( "credentials" ) . exists ( ) {
290303 print_field ( "Preserve file" , "~/.helix/credentials" ) ;
291304 }
@@ -497,9 +510,8 @@ fn provide_post_migration_guidance(ctx: &MigrationContext) -> Result<()> {
497510fn migrate_home_directory ( _ctx : & MigrationContext ) -> Result < ( ) > {
498511 print_status ( "HOME" , "Migrating ~/.helix directory" ) ;
499512
500- let home_dir = dirs:: home_dir ( ) . ok_or_else ( || {
501- CliError :: new ( "Could not find home directory" )
502- } ) ?;
513+ let home_dir =
514+ dirs:: home_dir ( ) . ok_or_else ( || CliError :: new ( "Could not find home directory" ) ) ?;
503515
504516 let v1_helix_dir = home_dir. join ( ".helix" ) ;
505517
@@ -526,8 +538,7 @@ fn migrate_home_directory(_ctx: &MigrationContext) -> Result<()> {
526538
527539 // Use the utility function to copy the directory without exclusions
528540 crate :: utils:: copy_dir_recursively ( & v1_helix_dir, & backup_dir) . map_err ( |e| {
529- CliError :: new ( "Failed to backup ~/.helix directory" )
530- . with_caused_by ( e. to_string ( ) )
541+ CliError :: new ( "Failed to backup ~/.helix directory" ) . with_caused_by ( e. to_string ( ) )
531542 } ) ?;
532543
533544 print_success ( "Created backup: ~/.helix-v1-backup" ) ;
@@ -546,8 +557,7 @@ fn migrate_home_directory(_ctx: &MigrationContext) -> Result<()> {
546557 let temp_credentials = if credentials_path. exists ( ) {
547558 let temp_path = home_dir. join ( ".helix-credentials-temp" ) ;
548559 fs:: rename ( & credentials_path, & temp_path) . map_err ( |e| {
549- CliError :: new ( "Failed to backup credentials" )
550- . with_caused_by ( e. to_string ( ) )
560+ CliError :: new ( "Failed to backup credentials" ) . with_caused_by ( e. to_string ( ) )
551561 } ) ?;
552562 Some ( temp_path)
553563 } else {
@@ -556,48 +566,40 @@ fn migrate_home_directory(_ctx: &MigrationContext) -> Result<()> {
556566
557567 let temp_repo = if repo_path. exists ( ) {
558568 let temp_path = home_dir. join ( ".helix-repo-temp" ) ;
559- fs:: rename ( & repo_path, & temp_path) . map_err ( |e| {
560- CliError :: new ( "Failed to backup repo" )
561- . with_caused_by ( e. to_string ( ) )
562- } ) ?;
569+ fs:: rename ( & repo_path, & temp_path)
570+ . map_err ( |e| CliError :: new ( "Failed to backup repo" ) . with_caused_by ( e. to_string ( ) ) ) ?;
563571 Some ( temp_path)
564572 } else {
565573 None
566574 } ;
567575
568576 // Remove the entire .helix directory
569577 fs:: remove_dir_all ( & v1_helix_dir) . map_err ( |e| {
570- CliError :: new ( "Failed to remove ~/.helix directory" )
571- . with_caused_by ( e. to_string ( ) )
578+ CliError :: new ( "Failed to remove ~/.helix directory" ) . with_caused_by ( e. to_string ( ) )
572579 } ) ?;
573580
574581 // Recreate .helix directory
575582 fs:: create_dir_all ( & v1_helix_dir) . map_err ( |e| {
576- CliError :: new ( "Failed to recreate ~/.helix directory" )
577- . with_caused_by ( e. to_string ( ) )
583+ CliError :: new ( "Failed to recreate ~/.helix directory" ) . with_caused_by ( e. to_string ( ) )
578584 } ) ?;
579585
580586 // Restore credentials and repo
581587 if let Some ( temp_creds) = temp_credentials {
582588 fs:: rename ( & temp_creds, & credentials_path) . map_err ( |e| {
583- CliError :: new ( "Failed to restore credentials" )
584- . with_caused_by ( e. to_string ( ) )
589+ CliError :: new ( "Failed to restore credentials" ) . with_caused_by ( e. to_string ( ) )
585590 } ) ?;
586591 print_info ( "Preserved ~/.helix/credentials" ) ;
587592 }
588593
589594 if let Some ( temp_repo) = temp_repo {
590- fs:: rename ( & temp_repo, & repo_path) . map_err ( |e| {
591- CliError :: new ( "Failed to restore repo" )
592- . with_caused_by ( e. to_string ( ) )
593- } ) ?;
595+ fs:: rename ( & temp_repo, & repo_path)
596+ . map_err ( |e| CliError :: new ( "Failed to restore repo" ) . with_caused_by ( e. to_string ( ) ) ) ?;
594597 print_info ( "Preserved ~/.helix/repo" ) ;
595598 }
596599
597600 // Create .v2 marker file to indicate migration is complete
598601 fs:: write ( & v2_marker, "" ) . map_err ( |e| {
599- CliError :: new ( "Failed to create v2 marker file" )
600- . with_caused_by ( e. to_string ( ) )
602+ CliError :: new ( "Failed to create v2 marker file" ) . with_caused_by ( e. to_string ( ) )
601603 } ) ?;
602604
603605 print_success ( "Cleaned up ~/.helix directory, preserving credentials and repo" ) ;
@@ -622,7 +624,13 @@ fn cleanup_dockerdev() -> Result<()> {
622624
623625 // Try to remove any helix-related images
624626 let output = std:: process:: Command :: new ( "docker" )
625- . args ( [ "images" , "--format" , "{{.Repository}}:{{.Tag}}" , "--filter" , "reference=helix*" ] )
627+ . args ( [
628+ "images" ,
629+ "--format" ,
630+ "{{.Repository}}:{{.Tag}}" ,
631+ "--filter" ,
632+ "reference=helix*" ,
633+ ] )
626634 . output ( ) ;
627635
628636 if let Ok ( output) = output {
@@ -636,7 +644,14 @@ fn cleanup_dockerdev() -> Result<()> {
636644
637645 // Try to remove helix volumes
638646 let output = std:: process:: Command :: new ( "docker" )
639- . args ( [ "volume" , "ls" , "--format" , "{{.Name}}" , "--filter" , "name=helix" ] )
647+ . args ( [
648+ "volume" ,
649+ "ls" ,
650+ "--format" ,
651+ "{{.Name}}" ,
652+ "--filter" ,
653+ "name=helix" ,
654+ ] )
640655 . output ( ) ;
641656
642657 if let Ok ( output) = output {
0 commit comments