Write `version` in generated `config.json`

This commit is contained in:
Luke Street 2023-09-13 17:07:06 -04:00
parent 42217a339e
commit 59a4eb33d0
3 changed files with 8 additions and 3 deletions

2
Cargo.lock generated
View File

@ -331,7 +331,7 @@ dependencies = [
[[package]]
name = "decomp-toolkit"
version = "0.5.0"
version = "0.5.1"
dependencies = [
"anyhow",
"ar",

View File

@ -3,7 +3,7 @@ name = "decomp-toolkit"
description = "Yet another GameCube/Wii decompilation toolkit."
authors = ["Luke Street <luke@street.dev>"]
license = "MIT OR Apache-2.0"
version = "0.5.0"
version = "0.5.1"
edition = "2021"
publish = false
build = "build.rs"

View File

@ -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<OutputModule>,
@ -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();