Fix for nested directories in tar archive (#2062)

* Fix for nested directories in tar archive

* fix untar for tar with a single directory

* prettier
This commit is contained in:
Matthias De Smet 2022-09-15 11:32:36 +02:00 committed by GitHub
parent 978087354e
commit b63b9f752d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -27,7 +27,7 @@ process UNTAR {
## Ensures --strip-components only applied when top level of tar contents is a directory ## Ensures --strip-components only applied when top level of tar contents is a directory
## If just files or multiple directories, place all in output ## If just files or multiple directories, place all in output
if [[ \$(tar -tzf ${archive} | grep "/\$" | wc -l) -eq 1 ]]; then if [[ \$(tar -tzf ${archive} | grep -o -P "^.*?\\/" | uniq | wc -l) -eq 1 ]]; then
tar \\ tar \\
-C output --strip-components 1 \\ -C output --strip-components 1 \\
-xzvf \\ -xzvf \\

View file

@ -15,7 +15,7 @@
tags: tags:
- untar - untar
files: files:
- path: output/untar/flowcell/220422_M11111_0222_000000000-K9H97/RunInfo.xml - path: output/untar/flowcell/RunInfo.xml
md5sum: 03038959f4dd181c86bc97ae71fe270a md5sum: 03038959f4dd181c86bc97ae71fe270a
- name: untar test_untar_onlyfiles - name: untar test_untar_onlyfiles