代码拉取完成,页面将自动刷新
const fs = require("fs");
const path = require("path");
var start_version = "1.7.0";
var start_i18n_version = "1.5.2";
const PRES = [
{
title: "download",
url: "https://oss-attachment.cn-hangzhou.oss.aliyun-inc.com/oss-browser/",
newUrl:
"https://oss-attachment.oss-cn-zhangjiakou.aliyuncs.com/ossbrowser/",
},
];
var t = [`# All Releases for [ OSS Browser ]\n`];
var vs = [];
var arr = fs.readdirSync("./release-notes");
arr.forEach((n) => {
var version = n.substring(0, n.length - path.extname(n).length);
try {
version = version.match(/^(\d+\.\d+\.\d+)/)[0];
} catch (e) {}
if (vs.indexOf(version) == -1 && compareVersion(version, start_version) <= 0)
vs.push(version);
});
//sort by version
vs.sort(compareVersion);
PRES.forEach((n) => {
t.push(`## Download from ${n.title}\n`);
t.push(`||Windows ia32|Windows x64| Mac(zip) |Linux ia32|Linux x64|Release note|
|-----|-----|-----|-----|--------|--------|---|`);
vs.forEach((version) => {
const url = compareVersion("1.16.0", version) < 0 ? n.url : n.newUrl;
var str = `|${version}|[Download](${url}${version}/oss-browser-win32-ia32.zip) |[Download](${url}${version}/oss-browser-win32-x64.zip) | [Download](${url}${version}/oss-browser-darwin-x64.zip) | [Download](${url}${version}/oss-browser-linux-ia32.zip) | [Download](${url}${version}/oss-browser-linux-x64.zip)|`;
if (compareVersion(version, start_i18n_version) >= 0)
str += "[" + version + ".md](release-notes/" + version + ".md)|";
else str += "[" + version + ".md](release-notes/" + version + ".en-US.md)|";
t.push(str);
});
t.push("");
});
t.push("");
t.push("[Earlier Releases](earlier-releases.md)");
fs.writeFileSync("./all-releases.md", t.join("\n"));
function compareVersion(a, b) {
var v1 = a.split(".");
var v2 = b.split(".");
for (var i = 0; i < v1.length; i++) {
if (parseInt(v1[i]) < parseInt(v2[i])) return 1;
else if (parseInt(v1[i]) > parseInt(v2[i])) return -1;
}
return -1;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。