Skip to content

Commit

Permalink
Update src/aiida_shell/launch.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sphuber authored Aug 28, 2024
1 parent ed1aa53 commit 1d7c39e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/aiida_shell/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,11 @@ def prepare_code(command: str, computer: Computer | None = None, resolve_command
:return: A :class:`aiida.orm.nodes.code.abstract.AbstractCode` instance.
:raises ValueError: If ``resolve_command=True`` and the code fails to determine the absolute path of the command.
"""
splitted_command = command.strip().split(' ')
if len(splitted_command) > 1:
command_split = command.strip().split(' ')
if len(command_split) > 1:
raise ValueError(
f'Command should only consist of one argument containing the executable '
f'but found {len(splitted_command)} arguments {splitted_command}. '
'Please add any further arguments to the `arguments` parameter in `launch_shell_job`.'
f'The command `{command}` appears to consist of multiple arguments: {command_split}. It should define '
'merely the executable, any other arguments should be specified using the `arguments` keyword.'
)

computer = prepare_computer(computer)
Expand Down

0 comments on commit 1d7c39e

Please sign in to comment.