Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
takuma-yoneda committed Dec 24, 2023
1 parent fd995b3 commit abd1f73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lmn/container/singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ def run(cmd: str, singularity_config: SingularityConfig) -> str:
options = SingularityCommand.make_options(c)

if c.startup:
if isinstance(c.startup, list):
startup = " ; ".join(c.startup)
startup = " ; ".join(c.startup) if isinstance(c.startup, list) else c.startup
cmd = f"{startup} ; {cmd}"
# Escape special chars and quotes (https://stackoverflow.com/a/18886646/19913466)
logger.debug(f"cmd before escape: {cmd}")
Expand Down
2 changes: 1 addition & 1 deletion lmn/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def exec(self, cmd: str, relative_workdir, conf: PBSConfig, env: Optional[dict]
exec_str = '\n'.join((
# NOTE: without `-S` option, `bash -i` will be considered a single command and will end up in command not found.
# Reference: https://unix.stackexchange.com/a/657774/556831
'#!/usr/bin/env -S bash -i',
'#!/usr/bin/env -S bash -i' if interactive else '#!/usr/bin/env bash',
*slurm_options,
*exports,
cmd
Expand Down

0 comments on commit abd1f73

Please sign in to comment.