Skip to content

Commit

Permalink
fix: quote paths given to singularity in order to ensure that it does…
Browse files Browse the repository at this point in the history
… not fail when paths contain whitespace (#2190)

### Description

<!--Add a description of your PR here-->

### QC
<!-- Make sure that you can tick the boxes below. -->

* [x] The PR contains a test case for the changes or the changes are
already covered by an existing test case.
* [x] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake).
  • Loading branch information
johanneskoester committed Apr 28, 2023
1 parent d903123 commit a572fb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions snakemake/deployment/singularity.py
Expand Up @@ -117,15 +117,15 @@ def shellcmd(

if is_python_script:
# mount host snakemake module into container
args += " --bind {}:{}".format(SNAKEMAKE_SEARCHPATH, SNAKEMAKE_MOUNTPOINT)
args += f" --bind {repr(SNAKEMAKE_SEARCHPATH)}:{repr(SNAKEMAKE_MOUNTPOINT)}"

if container_workdir:
args += " --pwd {}".format(container_workdir)
args += f" --pwd {repr(container_workdir)}"

cmd = "{} singularity {} exec --home {} {} {} {} -c '{}'".format(
envvars,
"--quiet --silent" if quiet else "",
os.getcwd(),
repr(os.getcwd()),
args,
img_path,
shell_executable,
Expand Down

0 comments on commit a572fb7

Please sign in to comment.