#!/usr/bin/env node 'use strict' // 下载页生成器:site/releases.json → site/index.html // 只做纯静态输出(无外链、无框架),部署到 NAS 的 nginx 静态目录。 const fs = require('fs') const path = require('path') const root = path.resolve(__dirname, '..') const inFile = process.argv[2] || path.join(root, 'site', 'releases.json') const outFile = process.argv[3] || path.join(root, 'site', 'download', 'index.html') const data = JSON.parse(fs.readFileSync(inFile, 'utf8')) const PLATFORMS = [ { key: 'darwin-aarch64', label: 'macOS · Apple Silicon', hint: 'M1 / M2 / M3 / M4' }, { key: 'darwin-x86_64', label: 'macOS · Intel', hint: 'x86_64' }, { key: 'windows-x86_64', label: 'Windows · x64', hint: '需要 WebView2' }, ] const esc = (s) => String(s == null ? '' : s).replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c])) const fmtSize = (n) => (!n ? '' : (n / 1048576).toFixed(1) + ' MB') function platformRow (rel, p) { const item = rel && rel.platforms ? rel.platforms[p.key] : null const meta = item ? '版本 ' + esc(rel.version) + ' · ' + fmtSize(item.size) + ' · .' + esc(item.kind || 'dmg') : '' const action = item ? '下载' : '暂未提供' const hash = item && item.sha256 ? '
${esc(data.subtitle || '')}
~/Documents/ImageWorkbench,可整目录备份与迁移。xattr -dr com.apple.quarantine "/Applications/image-workbench.app"
说明:安装包未做 Apple 公证($99/年开发者账号),所以第一次需要手动放行;这一步只做一次。
之后有新版本时,应用内 设置 → 通用 → 版本与更新 → 检查更新 就能一键升级,不用再下载安装包。
%USERPROFILE%\Documents\ImageWorkbench。scripts/gen-release-page.js 从 releases.json 生成 · 源码 git.maqiart.eu.org · 更新于 ${esc((data.updatedAt || '').slice(0, 10))}