icepick workflow: fix handling aliases in JSON inputs
This commit is contained in:
parent
f8f33a72ed
commit
adf1e68006
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue