@@ -52,6 +52,7 @@ class ToolOutputBase(Dictifiable):
5252 name : str
5353 label : Optional [str ]
5454 hidden : bool
55+ precreate_directory : bool
5556
5657 def __init__ (
5758 self ,
@@ -70,6 +71,7 @@ def __init__(
7071 self .hidden = hidden
7172 self .collection = False
7273 self .from_expression = from_expression
74+ self .precreate_directory = False
7375
7476 def to_dict (self , view = "collection" , value_mapper = None , app = None ):
7577 return super ().to_dict (view = view , value_mapper = value_mapper )
@@ -131,6 +133,7 @@ def __init__(
131133 self .change_format : List [ChangeFormatModel ] = []
132134 self .implicit = implicit
133135 self .from_work_dir : Optional [str ] = None
136+ self .precreate_directory : bool = False
134137 self .dataset_collector_descriptions : List [DatasetCollectionDescription ] = []
135138 self .default_identifier_source : Optional [str ] = None
136139 self .count : Optional [int ] = None
@@ -178,6 +181,7 @@ def to_model(self) -> ToolOutputDataModel:
178181 metadata_source = self .metadata_source ,
179182 discover_datasets = [d .to_model () for d in self .dataset_collector_descriptions ],
180183 from_work_dir = self .from_work_dir ,
184+ precreate_directory = self .precreate_directory ,
181185 )
182186
183187 @staticmethod
@@ -193,6 +197,7 @@ def from_dict(name: str, output_dict: Dict[str, Any], app: Optional[ToolOutputAc
193197 output .count = output_dict .get ("count" , 1 )
194198 output .filters = []
195199 output .from_work_dir = output_dict .get ("from_work_dir" )
200+ output .precreate_directory = output_dict .get ("precreate_directory" ) or False
196201 output .hidden = output_dict .get ("hidden" ) or False
197202 # TODO: implement tool output action group fixes
198203 if app is not None :
@@ -223,6 +228,7 @@ def __init__(self, name, output_type, from_expression, label=None, filters=None,
223228 self .change_format = []
224229 self .implicit = False
225230 self .from_work_dir = None
231+ self .precreate_directory = False
226232
227233 self .dataset_collector_descriptions = []
228234
0 commit comments