fix: shell split command args

This commit is contained in:
李衍志523370910113 2024-11-09 14:05:54 +08:00
parent bed58365f2
commit 912580eacf
3 changed files with 12 additions and 10 deletions

View File

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

View File

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

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