aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/config.rs')
-rw-r--r--crates/shirabe/src/config.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/shirabe/src/config.rs b/crates/shirabe/src/config.rs
index 68cad87..b3eb47d 100644
--- a/crates/shirabe/src/config.rs
+++ b/crates/shirabe/src/config.rs
@@ -451,6 +451,12 @@ impl Config {
.collect();
let new_repos_map: IndexMap<String, PhpMixed> = match &repositories_section {
PhpMixed::Array(m) => m.iter().map(|(k, v)| (k.clone(), v.clone())).collect(),
+ // A JSON array decodes to a List; in PHP it is an array with integer keys.
+ PhpMixed::List(items) => items
+ .iter()
+ .enumerate()
+ .map(|(i, v)| (i.to_string(), v.clone()))
+ .collect(),
_ => IndexMap::new(),
};
let new_repos: IndexMap<String, PhpMixed> = new_repos_map.into_iter().rev().collect();