airvzxf / airvzxf/ftp-deployment-action
chore(makefile): 'make clean' silently no-ops when neither docker nor podman is on PATH
- 主要语言
- Shell
- 星标
- 37
- 派生
- 9
- 平均合并
- 44 分钟
- 30 天内合并 PR
- 47
描述
## Problem
\`Makefile\` \`clean\` target uses \`RUNTIME := \$(shell command -v docker 2>/dev/null || command -v podman 2>/dev/null)\`. When neither binary exists, \`RUNTIME\` is empty and the recipe becomes \`- rmi -f \$(IMAGE) 2>/dev/null\` which \`make\` interprets as \`rmi -f ...\`. The shell prints \`sh: rmi: not found\` to stderr (swallowed by \`2>/dev/null\`), and the developer sees no feedback.
## Impact
UX nit; no data loss. A dev who runs \`make clean\` on a host without docker/podman sees no output and has no way to tell whether it worked.
## Suggested Fix
Guard the recipe at the top:
\`\`\`makefile
.PHONY: clean
clean:
@command -v docker >/dev/null 2>&1 || command -v podman >/dev/null 2>&1 || { \\
echo "make clean: no docker/podman on PATH; skipping"; \\
exit 0; }
-\$(RUNTIME) rmi -f \$(IMAGE)
-\$(RUNTIME) rmi -f \$(TEST_SERVER_IMAGE)
\`\`\`
## Source
F2 audit (v2.11.2), explorer-docs-security (MEDIUM).
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。