Skip to content

Commit

Permalink
js bug correction
Browse files Browse the repository at this point in the history
  • Loading branch information
AsteroidusTv committed Aug 1, 2023
1 parent 32ddd3c commit ffc4c85
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
9 changes: 9 additions & 0 deletions .fleet/run.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"configurations": [
{
"type": "cargo run",
"name": "Cargo configuration",
},

]
}
2 changes: 0 additions & 2 deletions src/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,13 @@ 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");
let file_path = ".data.json";
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.");
}


Expand Down
11 changes: 5 additions & 6 deletions src/languages/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}

5 changes: 1 addition & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -75,7 +73,6 @@ fn get_project_folders(paths: &str) -> Option<String> {
in_choices.push(last_folder.to_string());
}
}

// Push the create subfolder to the vector.
in_choices.push("Add a new subfolder".to_string());

Expand Down

0 comments on commit ffc4c85

Please sign in to comment.