Skip to content

Commit 3b7ec6c

Browse files
authored
Try to run "CWLFile" by default if no file provided (#189)
Try to run "CWLFile" by default if no file provided, analogus behavior to "make" and "Makefile"
1 parent 15a76a7 commit 3b7ec6c

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

cwltool/load_tool.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ def validate_document(document_loader, workflowobj, uri,
9292
"""Validate a CWL document."""
9393
jobobj = None
9494
if "cwl:tool" in workflowobj:
95-
jobobj = workflowobj
96-
uri = urlparse.urljoin(uri, jobobj["cwl:tool"])
97-
del jobobj["cwl:tool"]
95+
jobobj, _ = document_loader.resolve_all(workflowobj, uri)
96+
uri = urlparse.urljoin(uri, workflowobj["https://w3id.org/cwl/cwl#tool"])
97+
del cast(dict, jobobj)["https://w3id.org/cwl/cwl#tool"]
9898
workflowobj = fetch_document(uri)[1]
9999

100100
if isinstance(workflowobj, list):

cwltool/main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,9 +607,12 @@ def main(argsl=None,
607607
_logger.info(versionfunc())
608608

609609
if not args.workflow:
610-
_logger.error("")
611-
_logger.error("CWL document required, try --help for details")
612-
return 1
610+
if os.path.isfile("CWLFile"):
611+
setattr(args, "workflow", "CWLFile")
612+
else:
613+
_logger.error("")
614+
_logger.error("CWL document required, try --help for details")
615+
return 1
613616

614617
try:
615618
document_loader, workflowobj, uri = fetch_document(args.workflow)

0 commit comments

Comments
 (0)