Skip to content

Commit

Permalink
Download secondary files as well
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Oct 29, 2023
1 parent 04629a5 commit 260ee7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/galaxy/tool_util/cwl/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,12 @@ def dir_listing(dir_path):
if extra_file_class == "File":
ec = get_dataset(output_metadata, filename=path)
ec["basename"] = ec_basename
ec_properties = output_properties(pseudo_location=pseudo_location, **ec)
download_url = (
output_metadata["download_url"] + f"?filename={urllib.parse.quote_plus(path)}"
)
ec_properties = output_properties(
pseudo_location=pseudo_location, download_url=download_url, **ec
)
elif extra_file_class == "Directory":
ec_properties = {}
ec_properties["class"] = "Directory"
Expand Down
4 changes: 4 additions & 0 deletions lib/galaxy_test/base/populators.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ def conformance_tests_gen(directory, filename="conformance_tests.yaml"):

def output_to_disk(output, download_folder):
if isinstance(output, dict):
if "secondaryFiles" in output:
output["secondaryFiles"] = [
output_to_disk(secondary, download_folder=download_folder) for secondary in output["secondaryFiles"]
]
if "basename" in output:
download_path = os.path.join(download_folder, output["basename"])
download_to_file(output["location"], download_path)
Expand Down

0 comments on commit 260ee7b

Please sign in to comment.