summaryrefslogtreecommitdiff
path: root/gen/gen_iscc_script.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-02-04 00:27:16 +0800
committer魏曹先生 <1992414357@qq.com>2026-02-04 00:27:16 +0800
commitd19e5d84ee21502fd3440511d4ffb1ee1f49d3b2 (patch)
treefb8efef6f8e9a26c5b60d4ac220b11d6c6f0775e /gen/gen_iscc_script.rs
parent7ee0d3f20c875e7405bb8442c5eb0228d1599a03 (diff)
Refactor build system and implement complete renderer system
- Split monolithic build.rs into modular async generators - Add renderer override system with type-safe dispatch - Implement command template macro for consistent command definitions - Add proc-macro crates for command and renderer systems - Reorganize directory structure for better separation of concerns - Update documentation to reflect new architecture
Diffstat (limited to 'gen/gen_iscc_script.rs')
-rw-r--r--gen/gen_iscc_script.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/gen/gen_iscc_script.rs b/gen/gen_iscc_script.rs
new file mode 100644
index 0000000..1eddcca
--- /dev/null
+++ b/gen/gen_iscc_script.rs
@@ -0,0 +1,25 @@
+use std::path::PathBuf;
+
+use crate::r#gen::{
+ constants::{SETUP_JV_CLI_ISS, SETUP_JV_CLI_ISS_TEMPLATE},
+ env::{get_author, get_site, get_version},
+};
+
+/// Generate Inno Setup installer script (Windows only)
+pub async fn generate_installer_script(repo_root: &PathBuf) {
+ let template_path = repo_root.join(SETUP_JV_CLI_ISS_TEMPLATE);
+ let output_path = repo_root.join(SETUP_JV_CLI_ISS);
+
+ let template = tokio::fs::read_to_string(&template_path).await.unwrap();
+
+ let author = get_author().unwrap();
+ let version = get_version();
+ let site = get_site().unwrap();
+
+ let generated = template
+ .replace("<<<AUTHOR>>>", &author)
+ .replace("<<<VERSION>>>", &version)
+ .replace("<<<SITE>>>", &site);
+
+ tokio::fs::write(output_path, generated).await.unwrap();
+}