From adf1e680064d5db773a2d792835b09614bb3c265 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 28 Feb 2025 04:31:19 -0500 Subject: [PATCH] icepick workflow: fix handling aliases in JSON inputs --- crates/icepick/src/cli/workflow.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/crates/icepick/src/cli/workflow.rs b/crates/icepick/src/cli/workflow.rs index 6045a62..8500e04 100644 --- a/crates/icepick/src/cli/workflow.rs +++ b/crates/icepick/src/cli/workflow.rs @@ -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::(&input.name) { + match matches.get_one::(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; + } } } }