aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.ts9
-rw-r--r--makefile3
2 files changed, 12 insertions, 0 deletions
diff --git a/index.ts b/index.ts
index 07013ce..8048c6a 100644
--- a/index.ts
+++ b/index.ts
@@ -43,6 +43,15 @@ downloads.each(async (i, el) => {
}
versions.push(version);
if( i == downloadCount - 1 ) {
+ versions = versions.sort((a, b) => {
+ var dateFormat = /(\d{2})\.(\d{2})\.(\d{4})/;
+ var aR = a.date.match(dateFormat);
+ var bR = b.date.match(dateFormat);
+ return ( new Date(Number(bR[3]), Number(bR[2]) - 1, Number(bR[1])).getTime() ) -
+ ( new Date(Number(aR[3]), Number(aR[2]) - 1, Number(aR[1])).getTime() );
+ });
+ console.log(versions)
+
var minecraftVersions = {};
var latest: types.OptifineVersion;
var latestPre: types.OptifineVersion;
diff --git a/makefile b/makefile
index ccfe6bd..3446912 100644
--- a/makefile
+++ b/makefile
@@ -2,3 +2,6 @@ all:
mkdir out
node .
+clean:
+ rm -r out
+