Skip to content

Commit 30e5eb5

Browse files
committed
copy file
1 parent c4a9a04 commit 30e5eb5

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

python_workflow_definition/src/python_workflow_definition/cwl/__main__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ def convert_argument(arg):
2727
for arg in argument_lst
2828
if "--function=" in arg
2929
][0]
30+
file = [
31+
load_function(funct=arg.split("=")[-1])
32+
for arg in argument_lst
33+
if "--workflowfile=" in arg
34+
][0]
35+
shutil.copyfile(file, os.curdir)
3036
kwargs = {
3137
arg.split("=")[0][6:]: convert_argument(arg=arg.split("=")[-1])
3238
for arg in argument_lst

python_workflow_definition/src/python_workflow_definition/cwl/export.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,18 @@ def _write_function_cwl(workflow):
9898
},
9999
"workflowfile": {
100100
"type": "File",
101-
"inputBinding": {"position": 2},
101+
"inputBinding": {"position": 2, "prefix": "--workflowfile=", "separate": False},
102102
"default": {"class": "File", "location": "workflow.py"},
103103
},
104104
},
105105
"outputs": {},
106106
}
107-
template["inputs"]["workflowfile"]["default"]["location"] = (
108-
function_nodes_dict[i].split(".")[0] + ".py"
109-
)
110107
file_name = function_nodes_dict[i].split(".")[-1] + ".cwl"
111108
if file_name not in file_lst:
112109
file_lst.append(file_name)
110+
template["inputs"]["workflowfile"]["default"]["location"] = (
111+
function_nodes_dict[i].split(".")[0] + ".py"
112+
)
113113
template["inputs"].update(
114114
_get_function_template(function_name=function_nodes_dict[i])
115115
)

0 commit comments

Comments
 (0)