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 hashlib
import shlex
import socket import socket
from joj3_config_generator.models import ( from joj3_config_generator.models import (
@ -59,8 +60,8 @@ def getHealthcheckCmd(repo_conf: Repo) -> Cmd:
args = args + immutable_files args = args + immutable_files
cmd = Cmd( cmd = result.Cmd(
args=args.split(), args=shlex.split(args),
# FIXME: easier to edit within global scope # FIXME: easier to edit within global scope
copy_in={ copy_in={
f"./repo-health-checker": result.CmdFile(src=f"./repo-health-checker") 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 from typing import Any, Dict, Tuple
import rtoml import rtoml
@ -64,9 +65,13 @@ def get_executorWithConfig(
and (task_stage.files is not None) and (task_stage.files is not None)
else [] else []
) )
executor_with_config = ExecutorWithConfig( executor_with_config = result.ExecutorWith(
default=Cmd( 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={ copy_in={
file: CmdFile(src=f"/home/tt/.config/joj/{file}") file: CmdFile(src=f"/home/tt/.config/joj/{file}")
for file in copy_in_files for file in copy_in_files

View File

@ -531,11 +531,7 @@
"default": { "default": {
"args": [ "args": [
"cppcheck", "cppcheck",
"--template='{\"file\":\"{file}\",\"line\":{line},", "--template={\"file\":\"{file}\",\"line\":{line}, \"column\":{column}, \"severity\":\"{severity}\", \"message\":\"{message}\", \"id\":\"{id}\"}",
"\"column\":{column},",
"\"severity\":\"{severity}\",",
"\"message\":\"{message}\",",
"\"id\":\"{id}\"}'",
"--force", "--force",
"--enable=all", "--enable=all",
"--suppress=missingIncludeSystem", "--suppress=missingIncludeSystem",