fix: deploy.sh also looks for binary in script directory (offline package mode)

This commit is contained in:
tian 2026-07-21 14:45:44 +08:00
parent 9b844b7b55
commit 3ce5bff933

View File

@ -227,6 +227,14 @@ cmd_install_media_server() {
# 检查编译产物
if [ ! -f "$BUILD_DIR/safesight-edge-server" ]; then
# 离线包模式:二进制在脚本同目录
SCRIPT_DIR_OVERRIDE="$(cd "$(dirname "$0")" && pwd)"
if [ -f "$SCRIPT_DIR_OVERRIDE/safesight-edge-server" ]; then
BUILD_DIR="$SCRIPT_DIR_OVERRIDE"
echo -e "${GREEN}${NC} 使用离线包二进制: $BUILD_DIR/safesight-edge-server"
fi
fi
if [ ! -f "$BUILD_DIR/safesight-edge-server" ]; then
echo -e "${RED}错误: 未找到编译好的 safesight-edge-server${NC}"
echo "请先编译: cd $PROJECT_DIR && cmake --build build"
exit 1