4 Star 13 Fork 5

Gitee 极速下载/oss-browser

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/aliyun/oss-browser
克隆/下载
gen.js 1.96 KB
一键复制 编辑 原始数据 按行查看 历史
csg01123119 提交于 2023-12-27 16:06 . chore: release/1.18.0
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;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/mirrors/oss-browser.git
git@gitee.com:mirrors/oss-browser.git
mirrors
oss-browser
oss-browser
develop

搜索帮助