#!/bin/bash # 定义文件路径 file="appsrc/appconfig/basic/zappversion.hpp" # 提取 VERSION 字符串,处理多个空格的情况 VERSION=$(grep -oP '#define VERSION\s*"\s*(\S+)\s*"' "$file" | sed 's/#define VERSION\s*"//;s/"//') # 输出 VERSION echo "VERSION: $VERSION" ./ ./build.sh aarch64-linux-gnu-strip ./build/app/* packetname=app-v$VERSION-aarm64 packetpath=/tmp/$packetname rm -rf $packetpath mkdir -p $packetpath/ cp ./build/app/* $packetpath/ cp -rf html $packetpath/ tar -czvf $packetpath.tar.gz -C /tmp/ $packetname mkdir -p ./release mv $packetpath.tar.gz ./release/ echo "Release package is in ./release/$packetname.tar.gz"