Skip to content

Commit 94cb961

Browse files
committed
expressions in iwdr
1 parent 4132a16 commit 94cb961

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
## 🚀 Features
33
- added NetworkAccess Requirment via `--net/--enable-network` in `s4n tool create` #104
44
- Support InlineTools in Workflow step #111
5-
- Support Files and Directories as `InitialWorkDirRequirement` (in additon to Dirents)
5+
- Support Expressions, Files and Directories as `InitialWorkDirRequirement` (in additon to Dirents)
66

77
## 🐛 Bugfixes
88
- fixed a bug with Dockerfile path resolution
99
- handle NetworkAccess Requirment in runner
10-
- ramping up runner conformance from 160/378 to 177/378
10+
- ramping up runner conformance from 160/378 to 179/378
1111

1212
# v0.5.2
1313
## 🐛 Bugfixes

crates/cwl-execution/src/validate.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,15 @@ fn set_placeholder_values_requirements(requirements: &mut Vec<Requirement>, runt
125125
Entry::Include(include.clone())
126126
}
127127
}
128+
} else if let WorkDirItem::Expression(expr) = listing {
129+
// this kind of expression seems to be unfolding into File or Directory itself.
130+
// So we just need to find the correct input and set it to listing
131+
let re = Regex::new(r"\$\(inputs.([\w.]*)\)").unwrap();
132+
if let Ok(Some(caps)) = re.captures(expr) {
133+
if let Some(input) = runtime.inputs.get(&caps[1]) {
134+
*listing = WorkDirItem::FileOrDirectory(Box::new(input.clone()));
135+
}
136+
}
128137
}
129138
}
130139
}

crates/cwl/src/requirements.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ fn get_entry_name(input: &str) -> String {
133133
#[serde(untagged)]
134134
pub enum WorkDirItem {
135135
Dirent(Dirent),
136-
FileOrDirectory(Box<DefaultValue>),
137136
Expression(String),
137+
FileOrDirectory(Box<DefaultValue>),
138138
}
139139

140140
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]

0 commit comments

Comments
 (0)