From c7a5859e1770dbc7cbc7cb1785c34b880162dfac Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 23 Feb 2026 01:23:40 +0900 Subject: fix(global): add ~/.composer fallback, XDG auto-detection, and no-arg handling Rewrite composer_home() with Composer-compatible resolution: detect XDG environment (any XDG_* var or /etc/xdg), prefer existing directories, and fall back to ~/.composer for legacy systems. Consolidate duplicate composer_home_dir() from global.rs into shared config_helpers. Accept no subcommand gracefully with a helpful error instead of a parse error. Co-Authored-By: Claude Opus 4.6 --- crates/mozart/src/commands/repository.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/mozart/src/commands/repository.rs') diff --git a/crates/mozart/src/commands/repository.rs b/crates/mozart/src/commands/repository.rs index e9c52f4..f8e151d 100644 --- a/crates/mozart/src/commands/repository.rs +++ b/crates/mozart/src/commands/repository.rs @@ -47,7 +47,7 @@ fn resolve_file_path(args: &RepositoryArgs, cli: &super::Cli) -> anyhow::Result< anyhow::bail!("Cannot combine --global and --file"); } if args.global { - return Ok(PathBuf::from(composer_home()).join("config.json")); + return Ok(composer_home().join("config.json")); } if let Some(ref file) = args.file { return Ok(PathBuf::from(file)); -- cgit v1.3.1