Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
fankaiLiu committed Nov 26, 2023
1 parent 999a966 commit fc1b401
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/utils/create_project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@ pub fn write_project_file(
let mut db_templates = vec![
("src/db.rs", include_str!("../template/src/db.hbs")),
(
"src/router/user.rs",
"src/routers/user.rs",
include_str!("../template/src/routers/user.hbs"),
),
(
"src/router/static_routers.rs",
"src/routers/static_routers.rs",
include_str!("../template/src/routers/static_routers.hbs"),
),
(
Expand Down Expand Up @@ -541,11 +541,10 @@ pub fn write_project_file(
let users_json_bytes = include_bytes!("../template/data/users.json");
let mut users_json_file = File::create(data_path.join("users.json"))?;
users_json_file.write_all(users_json_bytes)?;
templates.append(&mut db_templates);
}
templates.append(&mut db_templates);
}
for (file_name, template) in &templates {
dbg!(&project_path.join(file_name));
render_and_write_to_file(&handlebars, template, &data, project_path.join(file_name))?;
}
Ok(())
Expand Down

0 comments on commit fc1b401

Please sign in to comment.