From 4f78e6c6497135cbc2923089ee26f5a50e43f06a Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 5 May 2026 16:51:50 +0900 Subject: refactor(commands): consolidate working_dir resolution into Cli method --- crates/mozart/src/commands/browse.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'crates/mozart/src/commands/browse.rs') diff --git a/crates/mozart/src/commands/browse.rs b/crates/mozart/src/commands/browse.rs index 24fc46f..7ee1858 100644 --- a/crates/mozart/src/commands/browse.rs +++ b/crates/mozart/src/commands/browse.rs @@ -1,7 +1,7 @@ use clap::Args; use mozart_core::console_format; use mozart_core::exit_code; -use std::path::{Path, PathBuf}; +use std::path::Path; use std::process::Command; #[derive(Args)] @@ -28,10 +28,7 @@ pub async fn execute( let cache_config = mozart_registry::cache::build_cache_config(cli.no_cache); let repo_cache = mozart_registry::cache::Cache::repo(&cache_config); - let working_dir = match &cli.working_dir { - Some(dir) => PathBuf::from(dir), - None => std::env::current_dir()?, - }; + let working_dir = cli.working_dir()?; // If no packages specified, use root package name from composer.json let packages: Vec = if args.packages.is_empty() { -- cgit v1.3.1