From 59a4eb33d024f8a0016f8416ab97e7da359a10c5 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Wed, 13 Sep 2023 17:07:06 -0400 Subject: [PATCH] Write `version` in generated `config.json` --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/cmd/dol.rs | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f70f362..8b4aeb3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -331,7 +331,7 @@ dependencies = [ [[package]] name = "decomp-toolkit" -version = "0.5.0" +version = "0.5.1" dependencies = [ "anyhow", "ar", diff --git a/Cargo.toml b/Cargo.toml index ccd0e45..1a544f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "decomp-toolkit" description = "Yet another GameCube/Wii decompilation toolkit." authors = ["Luke Street "] license = "MIT OR Apache-2.0" -version = "0.5.0" +version = "0.5.1" edition = "2021" publish = false build = "build.rs" diff --git a/src/cmd/dol.rs b/src/cmd/dol.rs index 24a5a65..d45c987 100644 --- a/src/cmd/dol.rs +++ b/src/cmd/dol.rs @@ -276,6 +276,7 @@ pub struct OutputModule { #[derive(Serialize, Deserialize, Debug, Clone, Default)] pub struct OutputConfig { + pub version: String, #[serde(flatten)] pub base: OutputModule, pub modules: Vec, @@ -1036,7 +1037,11 @@ fn split(args: SplitArgs) -> Result<()> { }); }); let duration = start.elapsed(); - let out_config = OutputConfig { base: dol_result.unwrap()?, modules: modules_result.unwrap()? }; + let out_config = OutputConfig { + version: env!("CARGO_PKG_VERSION").to_string(), + base: dol_result.unwrap()?, + modules: modules_result.unwrap()?, + }; let mut object_count = out_config.base.units.len(); for module in &out_config.modules { object_count += module.units.len();