From bfcec4cf502907aed10d6bbb417a3d0d7f914bcf Mon Sep 17 00:00:00 2001 From: qinjian Date: Thu, 11 Sep 2025 08:34:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E4=B8=BA=201.0.1=EF=BC=8C=E5=B9=B6=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E4=BB=8E=20package.json=20=E4=B8=AD=E8=AF=BB=E5=8F=96=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- script/package-app.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b19adc5..b750a49 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wuyuanbiaoba-web", - "version": "1.0.0", + "version": "1.0.1", "main": "index.html", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", diff --git a/script/package-app.sh b/script/package-app.sh index 261b217..c7d4f75 100644 --- a/script/package-app.sh +++ b/script/package-app.sh @@ -2,7 +2,13 @@ # 应用打包脚本 - 在开发环境运行 APP_NAME="wuyuanbiaoba-web" -VERSION="1.0.0" +# 自动读取 package.json 的 version 字段,如果失败则用 latest +if [ -f package.json ]; then + VERSION=$(grep '"version"' package.json | head -1 | sed -E 's/.*"version": *"([^"]+)".*/\1/') + [ -z "$VERSION" ] && VERSION="latest" +else + VERSION="latest" +fi TARGET_DIR="./build" DEPLOY_PACKAGE="${APP_NAME}-${VERSION}.tar.gz"