Skip to content

Commit

Permalink
download_from_web task: allow user to specify the output filename
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkinsc committed Oct 14, 2024
1 parent cfb37cc commit 3423051
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pipes/WDL/tasks/tasks_utils.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ task download_from_web {
String https_web_address
String request_method = "GET"
String? output_filename
String? additional_wget_opts
Int disk_size = 50
Expand All @@ -194,18 +195,22 @@ task download_from_web {
description: "The URL to download; this is passed to wget"
}
request_method: {
description: "The request method (GET,POST,etc.)"
description: "The request method ('GET', 'POST', etc.) passed to wget. Optional (default: 'GET')"
}
additional_wget_opts: {
description: "Additional options passed to wget as part of the download command."
}
output_filename: {
description: "The filename to use for the downloaded file. This is optional, though it can be helpful in the event the server does not advise on a filename via the 'Content-Disposition' header."
}
}
command <<<
mkdir "downloaded"
pushd "downloaded"
wget \
--method ~{request_method} \
~{if defined(output_filename) then "--output-document ~{output_filename}" else ""} \
~{additional_wget_opts} \
~{https_web_address}
Expand Down

0 comments on commit 3423051

Please sign in to comment.