aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/config_helpers.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-23 01:06:57 +0900
committernsfisis <nsfisis@gmail.com>2026-02-23 01:06:57 +0900
commit28c8c8dfb0dff4dc87d585e06faaf96a4c2eefde (patch)
tree80e2352aa659709c91b62697b07a0be65aff1774 /crates/mozart/src/commands/config_helpers.rs
parent48dffd282efd8fa847b3636753d7c0d856672f36 (diff)
downloadphp-mozart-28c8c8dfb0dff4dc87d585e06faaf96a4c2eefde.tar.gz
php-mozart-28c8c8dfb0dff4dc87d585e06faaf96a4c2eefde.tar.zst
php-mozart-28c8c8dfb0dff4dc87d585e06faaf96a4c2eefde.zip
fix(config): add missing keys, implement --absolute, fix output format
Add 18 missing config keys to config_value_type() including cache-read-only (was in defaults but unmanageable), audit.* dotted keys, and bool-or-enum keys like store-auths and bump-after-update. Implement --absolute flag to resolve *-dir values to absolute paths. Fix render_value() to JSON-encode arrays and use lowercase "null", matching Composer output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/config_helpers.rs')
-rw-r--r--crates/mozart/src/commands/config_helpers.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/mozart/src/commands/config_helpers.rs b/crates/mozart/src/commands/config_helpers.rs
index 953f18b..31792f4 100644
--- a/crates/mozart/src/commands/config_helpers.rs
+++ b/crates/mozart/src/commands/config_helpers.rs
@@ -140,12 +140,12 @@ pub(crate) fn insert_repository(
/// single-line display (matching Composer's behaviour).
pub(crate) fn render_value(v: &serde_json::Value) -> String {
match v {
- serde_json::Value::Null => "NULL".to_string(),
+ serde_json::Value::Null => "null".to_string(),
serde_json::Value::Bool(b) => if *b { "true" } else { "false" }.to_string(),
serde_json::Value::Number(n) => n.to_string(),
serde_json::Value::String(s) => s.clone(),
- serde_json::Value::Array(arr) => {
- arr.iter().map(render_value).collect::<Vec<_>>().join(", ")
+ serde_json::Value::Array(_) => {
+ serde_json::to_string(v).unwrap_or_else(|_| "[]".to_string())
}
serde_json::Value::Object(obj) => {
if obj.is_empty() {