fix: harden Unix scripts and Makefile
This commit is contained in:
Regular → Executable
+3
-3
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user