fix: shell split command args

This commit is contained in:
李衍志523370910113 2024-11-09 14:05:54 +08:00
parent c36977c3fa
commit befcf4931d
3 changed files with 9 additions and 7 deletions

View File

@ -1,4 +1,5 @@
import hashlib
import shlex
import socket
from joj3_config_generator.models import joj1, repo, result, task
@ -48,7 +49,7 @@ def getHealthcheckCmd(repo_conf: repo.Config) -> result.Cmd:
args = args + immutable_files
cmd = result.Cmd(
args=args.split(),
args=shlex.split(args),
# FIXME: easier to edit within global scope
copy_in={
f"./repo-health-checker": result.CmdFile(src=f"./repo-health-checker")

View File

@ -1,3 +1,4 @@
import shlex
from typing import Any, Dict, Tuple
import rtoml
@ -59,7 +60,11 @@ def get_executorWithConfig(
)
executor_with_config = result.ExecutorWith(
default=result.Cmd(
args=(task_stage.command.split() if task_stage.command is not None else []),
args=(
shlex.split(task_stage.command)
if task_stage.command is not None
else []
),
copy_in={
file: result.CmdFile(src=f"/home/tt/.config/joj/{file}")
for file in copy_in_files

View File

@ -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",