update release scripts

This commit is contained in:
Leopoldthecoder
2017-10-26 12:50:28 +08:00
committed by 杨奕
parent 07acf66a69
commit cee3154304
10 changed files with 60 additions and 257 deletions

View File

@@ -390,7 +390,11 @@
const xhr = new XMLHttpRequest();
xhr.onreadystatechange = _ => {
if (xhr.readyState === 4 && xhr.status === 200) {
this.versions = JSON.parse(xhr.responseText);
const versions = JSON.parse(xhr.responseText);
this.versions = Object.keys(versions).slice(-2).reduce((prev, next) => {
prev[next] = versions[next];
return prev;
}, {});
}
};
xhr.open('GET', '/versions.json');