diff --git a/Cargo.lock b/Cargo.lock index 21ff5d3..347e0d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -798,7 +798,7 @@ checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "salvo-cli" -version = "0.1.22" +version = "0.1.23" dependencies = [ "ansi_term", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index bf31c7e..458fcdb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "salvo-cli" -version = "0.1.22" +version = "0.1.23" edition = "2021" authors = ["Fankai Liu liufankai137@outlook.com","mrxiaozhuox mrxzx.info@gmail.com"] keywords = ["salvo", "cli","template"] diff --git a/src/main.rs b/src/main.rs index 7a88103..519b325 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,7 @@ use i18n::set_locale; mod i18n; rust_i18n::i18n!("locales", fallback = "en"); #[derive(Parser, Debug)] -#[clap(version = "0.1.22", author = "Fankai liu ")] +#[clap(version = "0.1.23", author = "Fankai liu ")] struct Opts { #[clap(subcommand)] subcmd: SubCommand, diff --git a/src/utils/create_project.rs b/src/utils/create_project.rs index 3cc2a12..ba18fcf 100644 --- a/src/utils/create_project.rs +++ b/src/utils/create_project.rs @@ -184,7 +184,6 @@ fn write_project_file( let (src_path, router_path) = create_basic_file(project_path, &handlebars, &data)?; - if is_web_site { //templates let template_path = project_path.join("templates"); @@ -205,7 +204,6 @@ fn write_project_file( let assets_path = project_path.join("assets"); std::fs::create_dir_all(&assets_path)?; - //assets/favicon.ico let favicon_bytes = include_bytes!("../template/assets/favicon.ico"); let mut favicon_file = File::create(assets_path.join("favicon.ico"))?; @@ -267,8 +265,10 @@ fn write_project_file( router_user_file.write_all(router_user_rendered.as_bytes())?; //src/router/static_routers.rs - let router_static_routers_template = include_str!("../template/src/routers/static_routers.hbs"); - let router_static_routers_rendered = handlebars.render_template(router_static_routers_template, &data)?; + let router_static_routers_template = + include_str!("../template/src/routers/static_routers.hbs"); + let router_static_routers_rendered = + handlebars.render_template(router_static_routers_template, &data)?; let mut router_static_routers_file = File::create(router_path.join("static_routers.rs"))?; router_static_routers_file.write_all(router_static_routers_rendered.as_bytes())?; @@ -285,7 +285,7 @@ fn write_project_file( let services_user_rendered = handlebars.render_template(services_user_template, &data)?; let mut services_user_file = File::create(services_path.join("user.rs"))?; services_user_file.write_all(services_user_rendered.as_bytes())?; - + //src/utils let utils_path = src_path.join("utils"); std::fs::create_dir_all(&utils_path)?;