diff --git a/Cargo.lock b/Cargo.lock index 6264082..718e03b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1238,7 +1238,7 @@ checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "salvo-cli" -version = "0.1.35" +version = "0.1.36" dependencies = [ "ansi_term", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 53d3521..6bb5e3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "salvo-cli" -version = "0.1.35" +version = "0.1.36" edition = "2021" authors = ["Fankai Liu liufankai137@outlook.com","mrxiaozhuox mrxzx.info@gmail.com"] keywords = ["salvo", "cli","template"] diff --git a/src/utils/create_project.rs b/src/utils/create_project.rs index b63fc0b..a772159 100644 --- a/src/utils/create_project.rs +++ b/src/utils/create_project.rs @@ -435,29 +435,45 @@ pub fn write_project_file( data["introduction"] = handlebars::JsonValue::String(t!("introduction")); data["introduction_text"] = handlebars::JsonValue::String(t!("introduction_text")); data["seleted_sqlite"] = handlebars::JsonValue::String(t!("seleted_sqlite")); - data["run_the_project"]=handlebars::JsonValue::String(t!("run_the_project")); - data["run_the_tests"]=handlebars::JsonValue::String(t!("run_the_tests")); - data["sqlx_cli"]=handlebars::JsonValue::String(t!("sqlx_cli")); - data["about_salvo"]=handlebars::JsonValue::String(t!("about_salvo")); - data["about_salvo_text"]=handlebars::JsonValue::String(t!("about_salvo_text")); - data["tip_title"]=handlebars::JsonValue::String(t!("tip_title")); - data["password_tip"]=handlebars::JsonValue::String(t!("password_tip")); - data["config_tip"]=handlebars::JsonValue::String(t!("config_tip")); - data["orm_title"]=handlebars::JsonValue::String(t!("orm_title")); - data["sqlx_website"]=handlebars::JsonValue::String(t!("sqlx_website")); - data["sea_orm_website"]=handlebars::JsonValue::String(t!("sea_orm_website")); - data["diesel_website"]=handlebars::JsonValue::String(t!("diesel_website")); - data["rbatis_website"]=handlebars::JsonValue::String(t!("rbatis_website")); - data["mongodb_website"]=handlebars::JsonValue::String(t!("mongodb_website")); - data["initialization"]=handlebars::JsonValue::String(t!("initialization")); - data["initialization_sqlx_cli_not_sqlite"]=handlebars::JsonValue::String(t!("initialization_sqlx_cli_not_sqlite").replace(r"\n", "\n")); - data["initialization_seaorm_cli_not_sqlite"]=handlebars::JsonValue::String(t!("initialization_seaorm_cli_not_sqlite").replace(r"\n", "\n")); - data["initialization_diesel_cli_not_sqlite"]=handlebars::JsonValue::String(t!("initialization_diesel_cli_not_sqlite").replace(r"\n", "\n")); - data["initialization_rbatis_cli_not_sqlite"]=handlebars::JsonValue::String(t!("initialization_rbatis_cli_not_sqlite").replace(r"\n", "\n")); - data["sea_orm_cli_website"]=handlebars::JsonValue::String(t!("sea_orm_cli_website").replace(r"\n", "\n")); - data["diesel_cli_website"]=handlebars::JsonValue::String(t!("diesel_cli_website").replace(r"\n", "\n")); - data["mongodb_usage_import_user_data"]=handlebars::JsonValue::String(t!("mongodb_usage_import_user_data").replace(r"\n", "\n")); - render_and_write_to_file(&handlebars, include_str!("../template/README.md"), &data, project_path.join("README.md"))?; + data["run_the_project"] = handlebars::JsonValue::String(t!("run_the_project")); + data["run_the_tests"] = handlebars::JsonValue::String(t!("run_the_tests")); + data["sqlx_cli"] = handlebars::JsonValue::String(t!("sqlx_cli")); + data["about_salvo"] = handlebars::JsonValue::String(t!("about_salvo")); + data["about_salvo_text"] = handlebars::JsonValue::String(t!("about_salvo_text")); + data["tip_title"] = handlebars::JsonValue::String(t!("tip_title")); + data["password_tip"] = handlebars::JsonValue::String(t!("password_tip")); + data["config_tip"] = handlebars::JsonValue::String(t!("config_tip")); + data["orm_title"] = handlebars::JsonValue::String(t!("orm_title")); + data["sqlx_website"] = handlebars::JsonValue::String(t!("sqlx_website")); + data["sea_orm_website"] = handlebars::JsonValue::String(t!("sea_orm_website")); + data["diesel_website"] = handlebars::JsonValue::String(t!("diesel_website")); + data["rbatis_website"] = handlebars::JsonValue::String(t!("rbatis_website")); + data["mongodb_website"] = handlebars::JsonValue::String(t!("mongodb_website")); + data["initialization"] = handlebars::JsonValue::String(t!("initialization")); + data["initialization_sqlx_cli_not_sqlite"] = handlebars::JsonValue::String( + t!("initialization_sqlx_cli_not_sqlite").replace(r"\n", "\n"), + ); + data["initialization_seaorm_cli_not_sqlite"] = handlebars::JsonValue::String( + t!("initialization_seaorm_cli_not_sqlite").replace(r"\n", "\n"), + ); + data["initialization_diesel_cli_not_sqlite"] = handlebars::JsonValue::String( + t!("initialization_diesel_cli_not_sqlite").replace(r"\n", "\n"), + ); + data["initialization_rbatis_cli_not_sqlite"] = handlebars::JsonValue::String( + t!("initialization_rbatis_cli_not_sqlite").replace(r"\n", "\n"), + ); + data["sea_orm_cli_website"] = + handlebars::JsonValue::String(t!("sea_orm_cli_website").replace(r"\n", "\n")); + data["diesel_cli_website"] = + handlebars::JsonValue::String(t!("diesel_cli_website").replace(r"\n", "\n")); + data["mongodb_usage_import_user_data"] = + handlebars::JsonValue::String(t!("mongodb_usage_import_user_data").replace(r"\n", "\n")); + render_and_write_to_file( + &handlebars, + include_str!("../template/README.md"), + &data, + project_path.join("README.md"), + )?; Ok(()) }