diff --git a/modules.json b/modules.json index aa358fc..c503b74 100644 --- a/modules.json +++ b/modules.json @@ -107,7 +107,7 @@ }, "minimap2/index": { "branch": "master", - "git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d" + "git_sha": "73e062cf5e0ef346f65d73009b1b656299359fc5" }, "motus/merge": { "branch": "master", @@ -119,7 +119,7 @@ }, "multiqc": { "branch": "master", - "git_sha": "16eee433b87b303bda650131ac5a0b1ad725e166" + "git_sha": "5587389874dac9c9953a2ab6f01d49af81969492" }, "porechop": { "branch": "master", @@ -139,7 +139,7 @@ }, "untar": { "branch": "master", - "git_sha": "5e7b1ef9a5a2d9258635bcbf70fcf37dacd1b247" + "git_sha": "393dbd6ddafe3f18eac02893dd4a21e4d45de679" } } } diff --git a/modules/nf-core/modules/untar/main.nf b/modules/nf-core/modules/untar/main.nf index 4128652..007871b 100644 --- a/modules/nf-core/modules/untar/main.nf +++ b/modules/nf-core/modules/untar/main.nf @@ -25,12 +25,23 @@ process UNTAR { """ mkdir output - tar \\ - -C output --strip-components 1 \\ - -xzvf \\ - $args \\ - $archive \\ - $args2 + ## 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 + tar \\ + -C output --strip-components 1 \\ + -xzvf \\ + $args \\ + $archive \\ + $args2 + else + tar \\ + -C output \\ + -xzvf \\ + $args \\ + $archive \\ + $args2 + fi mv output ${untar} diff --git a/modules/nf-core/modules/untar/meta.yml b/modules/nf-core/modules/untar/meta.yml index d426919..ea7a3f3 100644 --- a/modules/nf-core/modules/untar/meta.yml +++ b/modules/nf-core/modules/untar/meta.yml @@ -26,9 +26,9 @@ output: Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - untar: - type: file - description: - pattern: "*.*" + type: directory + description: Directory containing contents of archive + pattern: "*/" - versions: type: file description: File containing software versions @@ -36,3 +36,5 @@ output: authors: - "@joseespinosa" - "@drpatelh" + - "@matthdsm" + - "@jfy133"