拆分代码;约束cli命令

This commit is contained in:
2026-06-02 14:54:08 +08:00
parent 9b8a517092
commit 40e699e173
17 changed files with 395 additions and 267 deletions
Executable
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ -n "${PYTHON:-}" ]; then
PYTHON_BIN="$PYTHON"
elif command -v python >/dev/null 2>&1; then
PYTHON_BIN="python"
else
PYTHON_BIN="python3"
fi
cd "$ROOT"
"$PYTHON_BIN" -m PyInstaller --noconfirm --clean tjwater.spec
BIN_PATH="$ROOT/dist/"
if [ ! -x "$BIN_PATH" ]; then
echo "build succeeded but executable was not created: $BIN_PATH" >&2
exit 1
fi
"$BIN_PATH" help >/dev/null
echo "built executable: $BIN_PATH"