Skip to content

Commit aaaa242

Browse files
committed
support File literals too
1 parent c7734d3 commit aaaa242

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

cwltool/main.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,14 @@ def pathToLoc(p):
592592
del p["path"]
593593

594594
def addSizes(p):
595-
try:
596-
p["size"] = os.stat(p["location"][7:]).st_size # strip off file://
597-
except OSError:
595+
if 'location' in p:
596+
try:
597+
p["size"] = os.stat(p["location"][7:]).st_size # strip off file://
598+
except OSError:
599+
pass
600+
elif 'contents' in p:
601+
p["size"] = len(p['contents'])
602+
else:
598603
return # best effort
599604

600605
visit_class(job_order_object, ("File", "Directory"), pathToLoc)

0 commit comments

Comments
 (0)