aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/run_script.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-05 16:51:50 +0900
committernsfisis <nsfisis@gmail.com>2026-05-05 16:51:50 +0900
commit4f78e6c6497135cbc2923089ee26f5a50e43f06a (patch)
tree72d0bf2e188d5675d895b1d2aace447dd585b748 /crates/mozart/src/commands/run_script.rs
parent2ad57b7efb685040b24d93aab5b81ddfbd0ebefb (diff)
downloadphp-mozart-4f78e6c6497135cbc2923089ee26f5a50e43f06a.tar.gz
php-mozart-4f78e6c6497135cbc2923089ee26f5a50e43f06a.tar.zst
php-mozart-4f78e6c6497135cbc2923089ee26f5a50e43f06a.zip
refactor(commands): consolidate working_dir resolution into Cli method
Diffstat (limited to 'crates/mozart/src/commands/run_script.rs')
-rw-r--r--crates/mozart/src/commands/run_script.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/crates/mozart/src/commands/run_script.rs b/crates/mozart/src/commands/run_script.rs
index e57d1c2..ab07b84 100644
--- a/crates/mozart/src/commands/run_script.rs
+++ b/crates/mozart/src/commands/run_script.rs
@@ -79,10 +79,7 @@ pub async fn execute(
cli: &super::Cli,
console: &mozart_core::console::Console,
) -> anyhow::Result<()> {
- let working_dir = match &cli.working_dir {
- Some(dir) => PathBuf::from(dir),
- None => std::env::current_dir()?,
- };
+ let working_dir = cli.working_dir()?;
// RunScriptCommand uses requireComposer in Composer; composer.json must exist.
let composer = mozart_core::composer::Composer::require(&working_dir)?;