fix: harden Unix scripts and Makefile

This commit is contained in:
FlipWind
2026-08-09 00:26:42 +08:00
parent b57726f434
commit 7c76365942
4 changed files with 36 additions and 16 deletions
Regular → Executable
+3 -3
View File
@@ -6,12 +6,12 @@ set -euo pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PY=""
if command -v python3 >/dev/null 2>&1; then
if command -v python3 >/dev/null 2>&1 && python3 -c "import sys" >/dev/null 2>&1; then
PY="python3"
elif command -v python >/dev/null 2>&1; then
elif command -v python >/dev/null 2>&1 && python -c "import sys" >/dev/null 2>&1; then
PY="python"
else
echo "[错误] 未找到 python3 / python, 请先安装 Python 3。" >&2
echo "[错误] 未找到可用的 python3 / python, 请先安装 Python 3。" >&2
exit 1
fi