aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/repository.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-23 01:23:40 +0900
committernsfisis <nsfisis@gmail.com>2026-02-23 01:23:40 +0900
commitc7a5859e1770dbc7cbc7cb1785c34b880162dfac (patch)
tree58081330c415776c9020771f12227889abcffa12 /crates/mozart/src/commands/repository.rs
parent7372dc668476cde4bcb789e586cb9a65af1afca0 (diff)
downloadphp-mozart-c7a5859e1770dbc7cbc7cb1785c34b880162dfac.tar.gz
php-mozart-c7a5859e1770dbc7cbc7cb1785c34b880162dfac.tar.zst
php-mozart-c7a5859e1770dbc7cbc7cb1785c34b880162dfac.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/repository.rs')
-rw-r--r--crates/mozart/src/commands/repository.rs2
1 files changed, 1 insertions, 1 deletions
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));