앱 버전 갱신문제
This commit is contained in:
@@ -8,6 +8,7 @@ CONF="${WORK_TREE}/desktop/src-tauri/tauri.conf.json"
|
||||
LATEST="${WORK_TREE}/frontend/public/desktop/updates/latest.json"
|
||||
UPDATES_DIR="${WORK_TREE}/frontend/public/desktop/updates"
|
||||
BUILD_INFO="${WORK_TREE}/dist-desktop/build-info.json"
|
||||
RELEASE_DIR="${WORK_TREE}/data/desktop-releases"
|
||||
|
||||
node -e "
|
||||
const fs = require('fs');
|
||||
@@ -16,6 +17,7 @@ const confPath = process.argv[1];
|
||||
const latestPath = process.argv[2];
|
||||
const updatesDir = process.argv[3];
|
||||
const buildInfoPath = process.argv[4];
|
||||
const releaseDir = process.argv[5];
|
||||
|
||||
const parse = v => String(v || '0.0.0').trim().replace(/^v/i, '').split('.').map(n => parseInt(n, 10) || 0);
|
||||
const cmp = (a, b) => {
|
||||
@@ -53,6 +55,13 @@ if (fs.existsSync(updatesDir)) {
|
||||
}
|
||||
}
|
||||
|
||||
if (releaseDir && fs.existsSync(releaseDir)) {
|
||||
for (const name of fs.readdirSync(releaseDir)) {
|
||||
const m = name.match(/GoldenChart[_-](\\d+\\.\\d+\\.\\d+)/i);
|
||||
if (m) base = maxVer(base, m[1]);
|
||||
}
|
||||
}
|
||||
|
||||
const parts = parse(base);
|
||||
while (parts.length < 3) parts.push(0);
|
||||
parts[2] += 1;
|
||||
@@ -66,4 +75,4 @@ try {
|
||||
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
|
||||
} catch { /* ignore */ }
|
||||
console.log(nv);
|
||||
" "$CONF" "$LATEST" "$UPDATES_DIR" "$BUILD_INFO"
|
||||
" "$CONF" "$LATEST" "$UPDATES_DIR" "$BUILD_INFO" "$RELEASE_DIR"
|
||||
|
||||
Reference in New Issue
Block a user