Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/wic/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
10 changes: 6 additions & 4 deletions src/wic/run_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down