Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fankaiLiu committed Nov 26, 2023
1 parent 18fc508 commit ce43bc6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/utils/create_project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,23 +599,23 @@ fn create_basic_file(

let templates = [
(
"/src/main.rs",
"src/main.rs",
include_str!("../template/src/main_template.hbs"),
),
(
"/src/Cargo.toml",
"src/Cargo.toml",
include_str!("../template/src/cargo_template.hbs"),
),
(
"/src/config.rs",
"src/config.rs",
include_str!("../template/src/config_template.hbs"),
),
(
"/src/app_error.rs",
"src/app_error.rs",
include_str!("../template/src/app_error.hbs"),
),
(
"/src/app_response.rs",
"src/app_response.rs",
include_str!("../template/src/app_response.hbs"),
),
];
Expand Down Expand Up @@ -827,7 +827,6 @@ fn render_and_write_to_file<T: AsRef<Path>>(

// Get the parent directory of the file
if let Some(parent) = file_path.as_ref().parent() {
// Create the parent directory if it doesn't exist
fs::create_dir_all(parent)?;
}

Expand Down

0 comments on commit ce43bc6

Please sign in to comment.