From 884d9ab32bbca7a8ec5c7ee7d42cbde0e7e6babf Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 5 May 2026 19:38:29 +0900 Subject: refactor(core): replace ComposerConfig with typed Config struct Config uses serde with kebab-case field mapping; known properties are strongly-typed fields and unknown keys flow into an extra BTreeMap. resolve_references is moved to the new config module. --- crates/mozart/src/commands/run_script.rs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'crates/mozart/src/commands/run_script.rs') diff --git a/crates/mozart/src/commands/run_script.rs b/crates/mozart/src/commands/run_script.rs index 4292809..7e5cbe4 100644 --- a/crates/mozart/src/commands/run_script.rs +++ b/crates/mozart/src/commands/run_script.rs @@ -110,12 +110,14 @@ pub async fn execute( let timeout = match args.timeout { Some(0) => None, Some(secs) => Some(Duration::from_secs(secs)), - None => composer - .config() - .get("process-timeout") - .and_then(|v| v.as_u64()) - .filter(|s| *s != 0) - .map(Duration::from_secs), + None => { + let t = composer.config().process_timeout; + if t != 0 { + Some(Duration::from_secs(t)) + } else { + None + } + } }; let dev_mode = !args.no_dev; @@ -445,12 +447,7 @@ fn wait_with_timeout( fn resolve_bin_dir(working_dir: &Path, composer: &mozart_core::composer::Composer) -> PathBuf { // bin-dir's `{$vendor-dir}` placeholder is already resolved by Composer::load. - let bin_dir = composer - .config() - .get("bin-dir") - .and_then(|v| v.as_str()) - .unwrap_or("vendor/bin"); - working_dir.join(bin_dir) + working_dir.join(&composer.config().bin_dir) } fn is_php_callback(entry: &str) -> bool { -- cgit v1.3.1