Compact find command in grafana-sidecar container.py

Use sh -c with implicit string concatenation to keep the find command
readable as a single shell expression.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erich Blume 2026-04-13 07:31:44 -07:00
commit d1b62a38d5

View file

@ -34,35 +34,13 @@ async def build(src: dagger.Directory) -> dagger.Container:
.with_exec([".venv/bin/pip", "install", "--no-cache-dir", "."])
.with_exec(
[
"find",
"/app/.venv",
"(",
"-type",
"d",
"-a",
"-name",
"test",
"-o",
"-name",
"tests",
")",
"-o",
"(",
"-type",
"f",
"-a",
"-name",
"*.pyc",
"-o",
"-name",
"*.pyo",
")",
"-exec",
"rm",
"-rf",
"{}",
"+",
],
"sh",
"-c",
"find /app/.venv"
" \\( -type d -a -name test -o -name tests \\)"
" -o \\( -type f -a -name '*.pyc' -o -name '*.pyo' \\)"
" -exec rm -rf {} +",
]
)
)