1- use anyhow:: { bail, Result } ;
21use crate :: {
32 config:: {
43 app_config:: AppConfigManager , locations:: LocationsProvider , projects:: ProjectsRetriever ,
54 } ,
65 project_init:: existing:: ExistingProjectInitializer ,
76} ;
7+ use anyhow:: { Result , bail} ;
88use std:: { fs, path:: Path } ;
99
1010pub struct InitCommand < ' a > {
@@ -44,11 +44,7 @@ impl<'a> InitCommand<'a> {
4444 Ok ( ( ) )
4545 }
4646
47- fn handle_with_unassociated (
48- & self ,
49- unassociated : Vec < String > ,
50- cwd : & Path ,
51- ) -> Result < ( ) > {
47+ fn handle_with_unassociated ( & self , unassociated : Vec < String > , cwd : & Path ) -> Result < ( ) > {
5248 println ! ( "Some projects in puff are not yet associated with a path on this machine." ) ;
5349 println ! ( "Associate one with the current directory, or create a new project." ) ;
5450 let choice = self . ask_about_unassociated ( & unassociated) ?;
@@ -98,10 +94,7 @@ impl<'a> InitCommand<'a> {
9894 }
9995 }
10096
101- fn ask_about_unassociated (
102- & self ,
103- unassociated : & ' a [ String ] ,
104- ) -> Result < UserChoice < ' a > > {
97+ fn ask_about_unassociated ( & self , unassociated : & ' a [ String ] ) -> Result < UserChoice < ' a > > {
10598 println ! ( "0) Create a new project" ) ;
10699 for ( i, project) in unassociated. iter ( ) . enumerate ( ) {
107100 println ! ( "{}) Associate with the project '{}'" , i + 1 , project) ;
@@ -123,7 +116,10 @@ impl<'a> InitCommand<'a> {
123116 }
124117 }
125118
126- println ! ( "Unrecognized option '{}'. Choose from the list below, or press Ctrl+C to cancel." , choice. trim( ) ) ;
119+ println ! (
120+ "Unrecognized option '{}'. Choose from the list below, or press Ctrl+C to cancel." ,
121+ choice. trim( )
122+ ) ;
127123
128124 self . ask_about_unassociated ( unassociated)
129125 }
0 commit comments