diff --git a/.fleet/run.json b/.fleet/run.json new file mode 100644 index 0000000..9fea465 --- /dev/null +++ b/.fleet/run.json @@ -0,0 +1,9 @@ +{ + "configurations": [ + { + "type": "cargo run", + "name": "Cargo configuration", + }, + + ] +} \ No newline at end of file diff --git a/src/config/config.rs b/src/config/config.rs index a337c8f..888857c 100644 --- a/src/config/config.rs +++ b/src/config/config.rs @@ -100,7 +100,6 @@ pub fn main() { _ => unreachable!(), } - println!("{}", choice); data.editor_response = choice.to_string(); let json_string = serde_json::to_string(&data).expect("Failed to serialize data to JSON"); @@ -108,7 +107,6 @@ pub fn main() { let mut file = File::create(file_path).expect("Failed to create file"); file.write_all(json_string.as_bytes()).expect("Failed to write data to file"); - println!("Data has been written to data.json."); } diff --git a/src/languages/html.rs b/src/languages/html.rs index 5a0eb83..aa01fd8 100644 --- a/src/languages/html.rs +++ b/src/languages/html.rs @@ -47,17 +47,16 @@ pub fn main(project_name: &str, with_js: &str) { let str_css_file = css_file.as_str(); let str_js_file = js_file.as_str(); + functions::create_dir(str_main_folder); + functions::create_dir(str_css_folder); + functions::create_file(str_html_file, str_html_content); + functions::create_file(str_css_file, css_content); + if with_js == "y" || with_js == "Y" { functions::create_dir(str_js_folder); functions::create_file(str_html_file, str_html_js_content); functions::create_file(str_js_file, "") } - - functions::create_dir(str_main_folder); - functions::create_dir(str_css_folder); - functions::create_file(str_html_file, str_html_content); - functions::create_file(str_css_file, css_content); - } diff --git a/src/main.rs b/src/main.rs index 49698c5..5ff3c39 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,9 +47,7 @@ fn command_execute(command: &str, args: Vec<&str>) { let output = cmd.output().expect("Failed to execute the command."); - if output.status.success() { - println!("Project created successfully") - } else { + if !output.status.success() { let stderr = String::from_utf8_lossy(&output.stderr); println!("Command error: {}", stderr); } @@ -75,7 +73,6 @@ fn get_project_folders(paths: &str) -> Option { in_choices.push(last_folder.to_string()); } } - // Push the create subfolder to the vector. in_choices.push("Add a new subfolder".to_string());