nf-core / sarek

Analysis pipeline to detect germline or somatic variants (pre-processing, variant calling and annotation) from WGS / targeted sequencing
https://nf-co.re/sarek
MIT License
349 stars 387 forks source link

Sanitize path #1568

Open maxulysse opened 1 week ago

maxulysse commented 1 week ago

Description of the bug

params.outdir + "/path/output/"

->

file(params.outdir + "/path/output/").toUriString()

Command used and terminal output

No response

Relevant files

No response

System information

No response

adamrtalbot commented 1 week ago

For context, the bug is that sometimes the path is resolved to include a double slash. This breaks certain filesystems:

e.g.

params.outdir = '/output/`

params.outdir + /path/ = /output//path/

Using file operations will solve this: https://www.nextflow.io/docs/latest/script.html#opening-files

Options: file(params.outdir).resolve("path") file(params.outdir) / "path" file("${params.outdir}/path") <- path object file("${params.outdir}/path").toUriString() <- string object