|
|
@@ -92,25 +92,31 @@ info "Nuitka 打包二进制(mode: $([ "$ONEFILE" = 1 ] && echo onefile单文
|
|
|
--assume-yes-for-downloads \
|
|
|
"$ENTRY"
|
|
|
|
|
|
-PLATSUFFIX="$(uname -s | tr 'A-Z' 'a-z')-$HOSTARCH"
|
|
|
+# 平台标签 + 可执行后缀(Windows 走 git-bash,uname 形如 MINGW64_NT)
|
|
|
+case "$(uname -s)" in
|
|
|
+ MINGW*|MSYS*|CYGWIN*) OSLABEL=windows; EXE=".exe" ;;
|
|
|
+ Darwin) OSLABEL=darwin; EXE="" ;;
|
|
|
+ *) OSLABEL=$(uname -s | tr 'A-Z' 'a-z'); EXE="" ;;
|
|
|
+esac
|
|
|
+PLATSUFFIX="$OSLABEL-$HOSTARCH"
|
|
|
mkdir -p dist-binary
|
|
|
if [ "$ONEFILE" = "1" ]; then
|
|
|
- BIN="$OUT/agentpaas"
|
|
|
+ BIN="$OUT/agentpaas$EXE"
|
|
|
[ -x "$BIN" ] || fail "未生成二进制"
|
|
|
- cp "$BIN" "dist-binary/agentpaas-$PLATSUFFIX"
|
|
|
- cp "$BIN" "dist-binary/agentpaas"
|
|
|
+ cp "$BIN" "dist-binary/agentpaas-$PLATSUFFIX$EXE"
|
|
|
+ cp "$BIN" "dist-binary/agentpaas$EXE"
|
|
|
echo ""
|
|
|
- ok "单文件二进制已生成 → dist-binary/agentpaas ($(du -h "$BIN" | cut -f1))"
|
|
|
- echo " 用户用法(无需 Python): ./agentpaas serve --port 8000"
|
|
|
+ ok "单文件二进制已生成 → dist-binary/agentpaas$EXE ($(du -h "$BIN" | cut -f1))"
|
|
|
+ echo " 用户用法(无需 Python): ./agentpaas$EXE serve --port 8000"
|
|
|
else
|
|
|
# standalone:产出一个目录,整目录即发行件
|
|
|
DISTDIR="$OUT/__main__.dist"
|
|
|
- [ -x "$DISTDIR/agentpaas" ] || fail "未生成 standalone 目录二进制"
|
|
|
+ [ -x "$DISTDIR/agentpaas$EXE" ] || fail "未生成 standalone 目录二进制"
|
|
|
rm -rf "dist-binary/agentpaas-$PLATSUFFIX.app"
|
|
|
cp -R "$DISTDIR" "dist-binary/agentpaas-$PLATSUFFIX.app"
|
|
|
echo ""
|
|
|
ok "standalone 目录已生成 → dist-binary/agentpaas-$PLATSUFFIX.app/ ($(du -sh "$DISTDIR" | cut -f1))"
|
|
|
- echo " 用户用法(无需 Python): ./agentpaas-$PLATSUFFIX.app/agentpaas serve --port 8000"
|
|
|
+ echo " 用户用法(无需 Python): ./agentpaas-$PLATSUFFIX.app/agentpaas$EXE serve --port 8000"
|
|
|
fi
|
|
|
echo ""
|
|
|
warn "提醒: 二进制绑定 $PLATSUFFIX —— 换平台/架构需在对应机器重新构建。"
|