File tree Expand file tree Collapse file tree 5 files changed +30
-25
lines changed Expand file tree Collapse file tree 5 files changed +30
-25
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,14 @@ pub fn proj(proj_name: &String) -> Result<(), LionError> {
30
30
eprintln ! ( "Failed to create common directories: {}" , err) ;
31
31
}
32
32
33
+ if let Err ( error) = fs:: DirBuilder :: new ( )
34
+ . recursive ( true )
35
+ . create ( format ! ( "{proj_name}/external" ) )
36
+ {
37
+ println ! ( "An error occurred while trying to create C project: {error}" )
38
+ } ;
33
39
Ok (
34
- if let Err ( error) = fs:: DirBuilder :: new ( )
35
- . recursive ( true )
36
- . create ( format ! ( "{proj_name}/external" ) )
37
- {
38
- println ! ( "An error occurred while trying to create C project: {error}" )
39
- } ,
40
+ ( ) ,
40
41
)
41
42
}
42
43
Original file line number Diff line number Diff line change @@ -31,13 +31,14 @@ pub fn proj(proj_name: &String) -> Result<(), LionError> {
31
31
eprintln ! ( "Failed to create common directories: {}" , err) ;
32
32
}
33
33
34
+ if let Err ( error) = fs:: DirBuilder :: new ( )
35
+ . recursive ( true )
36
+ . create ( format ! ( "{proj_name}/external" ) )
37
+ {
38
+ eprintln ! ( "An error occurred while creating C++ project: {error}" )
39
+ } ;
34
40
Ok (
35
- if let Err ( error) = fs:: DirBuilder :: new ( )
36
- . recursive ( true )
37
- . create ( format ! ( "{proj_name}/external" ) )
38
- {
39
- eprintln ! ( "An error occurred while creating C++ project: {error}" )
40
- } ,
41
+ ( ) ,
41
42
)
42
43
}
43
44
Original file line number Diff line number Diff line change @@ -31,15 +31,16 @@ pub fn dep(dep: &String) -> Result<(), LionError> {
31
31
}
32
32
33
33
pub fn proj ( proj_name : & String ) -> Result < ( ) , LionError > {
34
+ if let Err ( error) = Command :: new ( "go" )
35
+ . arg ( "mod" )
36
+ . arg ( "init" )
37
+ . arg ( format ! ( "./{proj_name}" ) )
38
+ . status ( )
39
+ {
40
+ eprintln ! ( "An error occurred while trying to create go project: {error}" ) ;
41
+ } ;
34
42
Ok (
35
- if let Err ( error) = Command :: new ( "go" )
36
- . arg ( "mod" )
37
- . arg ( "init" )
38
- . arg ( format ! ( "./{proj_name}" ) )
39
- . status ( )
40
- {
41
- eprintln ! ( "An error occurred while trying to create go project: {error}" ) ;
42
- } ,
43
+ ( ) ,
43
44
)
44
45
}
45
46
Original file line number Diff line number Diff line change @@ -33,12 +33,13 @@ pub fn run(file_name: &String) -> Result<(), LionError> {
33
33
}
34
34
35
35
pub fn proj ( proj_name : & String ) -> Result < ( ) , LionError > {
36
- Ok ( if let Err ( err) = common_dir ( proj_name) {
36
+ if let Err ( err) = common_dir ( proj_name) {
37
37
eprintln ! (
38
38
"An error occured while trying to create java project: {}" ,
39
39
err
40
40
) ;
41
- } )
41
+ } ;
42
+ Ok ( ( ) )
42
43
}
43
44
44
45
pub fn new ( file_name : & String ) -> Result < ( ) , LionError > {
Original file line number Diff line number Diff line change @@ -27,10 +27,11 @@ pub fn run(file_name: &String) -> Result<(), LionError> {
27
27
}
28
28
29
29
pub fn proj ( proj_name : & String ) -> Result < ( ) , LionError > {
30
+ if let Err ( error) = Command :: new ( "cargo" ) . arg ( "new" ) . arg ( proj_name) . status ( ) {
31
+ eprintln ! ( "Error while trying to create Rust project: {}" , error) ;
32
+ } ;
30
33
Ok (
31
- if let Err ( error) = Command :: new ( "cargo" ) . arg ( "new" ) . arg ( proj_name) . status ( ) {
32
- eprintln ! ( "Error while trying to create Rust project: {}" , error) ;
33
- } ,
34
+ ( ) ,
34
35
)
35
36
}
36
37
You can’t perform that action at this time.
0 commit comments