Browse Source

fix: 更新版本号为 1.0.1,并自动从 package.json 中读取版本信息

master latest
qinjian 1 month ago
parent
commit
bfcec4cf50
  1. 2
      package.json
  2. 8
      script/package-app.sh

2
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",

8
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"

Loading…
Cancel
Save