-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore cache if Nextclade version is different
Currently just checks Nextclade and dataset versions of the first row of the nextclade.tsv file and formats them as the intended JSON proposed. Once the version JSON metadata file is in place, it should be easy to swap out the check for the separate file rather than the nextclade.tsv.
- Loading branch information
1 parent
055c5b7
commit 5c2fcd8
Showing
3 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
s3_url="${1:?An S3 URL is required as the first argument}" | ||
|
||
|
||
trap '' SIGPIPE | ||
|
||
(aws s3 cp "${s3_url}" - \ | ||
| zstd -T0 -dcq \ | ||
| head -n 2 \ | ||
| tsv-select -H -f 'nextclade_version,dataset_version' \ | ||
| tail -n 1 \ | ||
| jq --raw-input --slurp -c ' | ||
split("\n") | ||
| map(split("\t")) | ||
| .[0:-1] | ||
| map( { "nextclade_version": .[0], "nextclade_dataset_version": .[1] } ) | ||
| .[0]') \ | ||
2> /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters