@@ -23,18 +23,22 @@ def is_url(item_path):
23
23
return True
24
24
25
25
26
+ def export_local_files (item_path , io_paths ):
27
+ """ Export local files to the new directory """
28
+ if io_paths :
29
+ output_path = os .path .join (io_paths ['output' ], 'artifacts' , item_path )
30
+ input_path = os .path .join (io_paths ['input' ], item_path )
31
+ utils .create_dir (os .path .dirname (output_path ))
32
+ if not os .path .exists (output_path ) or not filecmp .cmp (input_path , output_path ):
33
+ shutil .copy (input_path , output_path )
34
+
35
+
26
36
def prepare_locally_stored_files (element , io_paths ):
27
37
""" Prepare the files by moving locally stored files to the `artifacts` directory
28
38
and linking filepaths to that directory """
29
39
item_path = element .get ('path' )
30
40
if item_path and not is_url (item_path ):
31
41
element ['path' ] = os .path .join ('/artifacts' , item_path ).replace ('\\ ' , '/' )
32
- if io_paths :
33
- output_path = os .path .join (io_paths ['output' ], 'artifacts' , item_path )
34
- input_path = os .path .join (io_paths ['input' ], item_path )
35
- utils .create_dir (os .path .dirname (output_path ))
36
- if not os .path .exists (output_path ) or not filecmp .cmp (input_path , output_path ):
37
- shutil .copy (input_path , output_path )
38
42
39
43
40
44
def convert_element (element , io_paths = None ):
0 commit comments