aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/run_script.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-05 19:38:29 +0900
committernsfisis <nsfisis@gmail.com>2026-05-05 19:38:29 +0900
commit884d9ab32bbca7a8ec5c7ee7d42cbde0e7e6babf (patch)
treee04e25f506f0174572b4634601ab9b317220d9e5 /crates/mozart/src/commands/run_script.rs
parent49b0884701a84731652fc934d428932ff6029bd4 (diff)
downloadphp-mozart-884d9ab32bbca7a8ec5c7ee7d42cbde0e7e6babf.tar.gz
php-mozart-884d9ab32bbca7a8ec5c7ee7d42cbde0e7e6babf.tar.zst
php-mozart-884d9ab32bbca7a8ec5c7ee7d42cbde0e7e6babf.zip
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.
Diffstat (limited to 'crates/mozart/src/commands/run_script.rs')
-rw-r--r--crates/mozart/src/commands/run_script.rs21
1 files changed, 9 insertions, 12 deletions
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 {