diff --git a/src/wic/compiler.py b/src/wic/compiler.py index 5ba74d3a..5dfaf91d 100644 --- a/src/wic/compiler.py +++ b/src/wic/compiler.py @@ -866,7 +866,7 @@ def compile_workflow_once(yaml_tree_ast: YamlTree, new_keyval: WorkflowInputsFile = {} if 'File' == in_dict['type']: # path = Path(in_dict['value']).name # NOTE: Use .name ? - newval = {'class': 'File', 'path': in_dict['value']} + newval = {'class': 'File', 'location': in_dict['value']} if 'format' in in_dict: in_format = in_dict['format'] if isinstance(in_format, List): diff --git a/src/wic/run_local.py b/src/wic/run_local.py index 8b14db4d..e460304f 100644 --- a/src/wic/run_local.py +++ b/src/wic/run_local.py @@ -325,19 +325,21 @@ def stage_input_files(yml_inputs: Yaml, root_yml_dir_abs: Path, FileNotFoundError: If throw and it any of the input files do not exist. """ for key, val in yml_inputs.items(): - if isinstance(val, Dict) and val.get('class', '') == 'File': - path = root_yml_dir_abs / Path(val['path']) + if isinstance(val, Dict) and val.get('class', '') in ['File', 'Directory']: + path = root_yml_dir_abs / Path(val['location']) if not path.exists() and throw: # raise FileNotFoundError(f'Error! {path} does not exist!') print(f'Error! {path} does not exist!') sys.exit(1) relpath = Path('autogenerated/') if relative_run_path else Path('.') - pathauto = relpath / Path(val['path']) # .name # NOTE: Use .name ? + pathauto = relpath / Path(val['location']) # .name # NOTE: Use .name ? pathauto.parent.mkdir(parents=True, exist_ok=True) + if val['class'] == 'Directory': + pathauto = pathauto.parent if path != pathauto: - cmd = ['cp', str(path), str(pathauto)] + cmd = ['cp', '-r', str(path), str(pathauto)] proc = sub.run(cmd, check=False)