Fix for nested directories in tar archive (#2062)

* Fix for nested directories in tar archive

* fix untar for tar with a single directory

* prettier
master
Matthias De Smet 2 years ago committed by GitHub
parent 978087354e
commit b63b9f752d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -27,7 +27,7 @@ process UNTAR {
## 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 [[ \$(tar -tzf ${archive} | grep "/\$" | wc -l) -eq 1 ]]; then
if [[ \$(tar -tzf ${archive} | grep -o -P "^.*?\\/" | uniq | wc -l) -eq 1 ]]; then
tar \\
-C output --strip-components 1 \\
-xzvf \\

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

Loading…
Cancel
Save