diff --git a/lib/crates/fabro-cli/src/commands/run/command.rs b/lib/crates/fabro-cli/src/commands/run/command.rs index 9a96b7d34..6ed10e0d4 100644 --- a/lib/crates/fabro-cli/src/commands/run/command.rs +++ b/lib/crates/fabro-cli/src/commands/run/command.rs @@ -6,12 +6,13 @@ use crate::args::{GlobalArgs, RunArgs}; pub(crate) async fn execute(mut args: RunArgs, _globals: &GlobalArgs) -> Result<()> { let styles: &'static Styles = Box::leak(Box::new(Styles::detect_stderr())); - let cli_settings = ConfigLayer::cli()?.resolve()?; + let cli = ConfigLayer::cli()?; + let cli_settings = cli.clone().resolve()?; args.verbose = args.verbose || cli_settings.verbose_enabled(); let quiet = args.detach; let prevent_idle_sleep = cli_settings.prevent_idle_sleep_enabled(); - let (run_id, run_dir) = super::create::create_run(&args, styles, quiet)?; + let (run_id, run_dir) = super::create::create_run(&args, cli, styles, quiet)?; #[cfg(feature = "sleep_inhibitor")] let _sleep_guard = crate::sleep_inhibitor::guard(prevent_idle_sleep); diff --git a/lib/crates/fabro-cli/src/commands/run/create.rs b/lib/crates/fabro-cli/src/commands/run/create.rs index 13792b600..b36d1835c 100644 --- a/lib/crates/fabro-cli/src/commands/run/create.rs +++ b/lib/crates/fabro-cli/src/commands/run/create.rs @@ -13,6 +13,7 @@ use super::output::{print_diagnostics_from_error, print_workflow_report_from_per /// This does NOT execute the workflow — it only prepares the run directory. pub(crate) fn create_run( args: &RunArgs, + cli_defaults: ConfigLayer, styles: &Styles, quiet: bool, ) -> anyhow::Result<(String, PathBuf)> { @@ -24,7 +25,7 @@ pub(crate) fn create_run( let cwd = std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")); let settings: FabroSettings = cli_args_config .combine(ConfigLayer::for_workflow(workflow_path, &cwd)?) - .combine(ConfigLayer::cli()?) + .combine(cli_defaults) .resolve()?; let created = match create(CreateRunInput { diff --git a/lib/crates/fabro-cli/src/commands/run/mod.rs b/lib/crates/fabro-cli/src/commands/run/mod.rs index a936ce072..b3add82fb 100644 --- a/lib/crates/fabro-cli/src/commands/run/mod.rs +++ b/lib/crates/fabro-cli/src/commands/run/mod.rs @@ -1,4 +1,5 @@ use anyhow::Result; +use fabro_config::ConfigLayer; use fabro_config::FabroSettingsExt; use fabro_util::terminal::Styles; use fabro_workflows::run_lookup::{resolve_run_combined, runs_base}; @@ -34,7 +35,8 @@ pub(crate) async fn dispatch(cmd: RunCommands, globals: &GlobalArgs) -> Result<( RunCommands::Run(args) => command::execute(args, globals).await, RunCommands::Create(args) => { let styles: &'static Styles = Box::leak(Box::new(Styles::detect_stderr())); - let (run_id, _run_dir) = create::create_run(&args, styles, true)?; + let cli = ConfigLayer::cli()?; + let (run_id, _run_dir) = create::create_run(&args, cli, styles, true)?; println!("{run_id}"); Ok(()) }