Skip to content

Commit

Permalink
Fixed corner case of autofilled parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
jmfernandez committed Aug 31, 2023
1 parent a506473 commit 122eb68
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion wfexs_backend/ro_crate.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,8 +846,20 @@ def addWorkflowInputs(
"Sequence[Union[bool,str,float,int]]", in_item.values
):
if isinstance(itemInAtomicValues, (bool, str, float, int)):
# This case happens when an input is telling
# some kind of output file or directory.
# So, its value should be fixed, to avoid
# containing absolute paths
fixedAtomicValue: "Union[bool,str,float,int]"
if in_item.autoFilled:
fixedAtomicValue = os.path.relpath(
cast("str", itemInAtomicValues),
self.staged_setup.work_dir,
)
else:
fixedAtomicValue = itemInAtomicValues
parameter_value = PropertyValue(
self.crate, in_item.name, itemInAtomicValues
self.crate, in_item.name, fixedAtomicValue
)
crate_pv = self.crate.add(parameter_value)
if isinstance(crate_coll, Collection):
Expand Down

0 comments on commit 122eb68

Please sign in to comment.