diff --git a/joj3_config_generator/lib/repo.py b/joj3_config_generator/lib/repo.py index 669f3f8..e802cbf 100644 --- a/joj3_config_generator/lib/repo.py +++ b/joj3_config_generator/lib/repo.py @@ -1,4 +1,5 @@ import hashlib +import shlex import socket from joj3_config_generator.models import ( @@ -59,8 +60,8 @@ def getHealthcheckCmd(repo_conf: Repo) -> Cmd: args = args + immutable_files - cmd = Cmd( - args=args.split(), + cmd = result.Cmd( + args=shlex.split(args), # FIXME: easier to edit within global scope copy_in={ f"./repo-health-checker": result.CmdFile(src=f"./repo-health-checker") diff --git a/joj3_config_generator/lib/task.py b/joj3_config_generator/lib/task.py index eaa0604..50308b0 100644 --- a/joj3_config_generator/lib/task.py +++ b/joj3_config_generator/lib/task.py @@ -1,3 +1,4 @@ +import shlex from typing import Any, Dict, Tuple import rtoml @@ -64,9 +65,13 @@ def get_executorWithConfig( and (task_stage.files is not None) else [] ) - executor_with_config = ExecutorWithConfig( - default=Cmd( - args=(task_stage.command.split() if task_stage.command is not None else []), + executor_with_config = result.ExecutorWith( + default=result.Cmd( + args=( + shlex.split(task_stage.command) + if task_stage.command is not None + else [] + ), copy_in={ file: CmdFile(src=f"/home/tt/.config/joj/{file}") for file in copy_in_files diff --git a/tests/convert/basic/task.json b/tests/convert/basic/task.json index 9277b16..9d67b24 100644 --- a/tests/convert/basic/task.json +++ b/tests/convert/basic/task.json @@ -531,11 +531,7 @@ "default": { "args": [ "cppcheck", - "--template='{\"file\":\"{file}\",\"line\":{line},", - "\"column\":{column},", - "\"severity\":\"{severity}\",", - "\"message\":\"{message}\",", - "\"id\":\"{id}\"}'", + "--template={\"file\":\"{file}\",\"line\":{line}, \"column\":{column}, \"severity\":\"{severity}\", \"message\":\"{message}\", \"id\":\"{id}\"}", "--force", "--enable=all", "--suppress=missingIncludeSystem",