diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-23 01:11:23 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-23 01:11:23 +0900 |
| commit | 40bd784824dc5f40e22908ff35d4ae693696ba89 (patch) | |
| tree | c4175c1a46dae44b21ebd7314c8965f010175097 /crates/mozart/src/commands/depends.rs | |
| parent | 28c8c8dfb0dff4dc87d585e06faaf96a4c2eefde (diff) | |
| download | php-mozart-40bd784824dc5f40e22908ff35d4ae693696ba89.tar.gz php-mozart-40bd784824dc5f40e22908ff35d4ae693696ba89.tar.zst php-mozart-40bd784824dc5f40e22908ff35d4ae693696ba89.zip | |
fix(depends): prefer installed packages over lockfile and add platform support
Without --locked, prefer vendor/composer/installed.json over composer.lock
to match Composer's data source priority. Add platform packages (php, ext-*,
lib-*) from detect_platform() so queries like `depends php` work. Show a
specific error message when a platform package is not found.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/depends.rs')
| -rw-r--r-- | crates/mozart/src/commands/depends.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/mozart/src/commands/depends.rs b/crates/mozart/src/commands/depends.rs index 673fd35..c65f775 100644 --- a/crates/mozart/src/commands/depends.rs +++ b/crates/mozart/src/commands/depends.rs @@ -44,6 +44,12 @@ pub async fn execute( // Verify the target package is known let target_known = packages.iter().any(|p| p.name.to_lowercase() == target); + if !target_known && mozart_core::platform::is_platform_package(&target) { + anyhow::bail!( + "Could not find platform package \"{}\". Is PHP available?", + args.package + ); + } if !target_known { anyhow::bail!( "Could not find package \"{}\" in your project", |
