icepick workflow: fix handling aliases in JSON inputs

This commit is contained in:
Ryan Heywood 2025-02-28 04:31:19 -05:00
parent f8f33a72ed
commit adf1e68006
Signed by: ryan
GPG Key ID: 8E401478A3FBEF72
1 changed files with 9 additions and 4 deletions

View File

@ -124,15 +124,20 @@ fn load_inputs<'a>(
.and_then(|f| serde_json::from_reader(f).ok());
for input in inputs {
let identifier = &input.name;
match matches.get_one::<String>(&input.name) {
match matches.get_one::<String>(identifier) {
Some(value) => {
map.insert(identifier.clone(), value.clone());
continue;
}
None => {
if let Some(value) = input_file.as_ref().and_then(|f| f.get(identifier)) {
map.insert(identifier.clone(), value.clone());
continue;
for aliasable_identifier in input.identifiers() {
if let Some(value) = input_file
.as_ref()
.and_then(|f| f.get(aliasable_identifier))
{
map.insert(identifier.clone(), value.clone());
continue;
}
}
}
}