-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlint-versions.js
67 lines (57 loc) · 1.59 KB
/
lint-versions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
'use strict';
let Path = require('node:path');
let Fs = require('node:fs/promises');
let Lexver = require('./lexver.js');
async function main() {
let matchVer = process.argv[2];
if (!matchVer) {
// matchVer = 'v1.91.1';
matchVer = 'v1.991';
}
let versions;
{
let filepath = Path.join(__dirname, 'versions.txt');
let versionsTxt = await Fs.readFile(filepath, 'utf-8');
versionsTxt = versionsTxt.trim();
versions = versionsTxt.split('\n');
versions.push('1.990.0-rc1');
versions.push('1.990.0');
versions.push('1.990.0+hotfix1');
versions.push('1.991.0-rc1');
versions.push('1.991.0');
versions.push('1.991.0+hotfix1');
versions.push('1.991.1-rc9');
versions.push('1.991.1-rc10');
versions.push('1.991.1');
versions.push('1.991.1+hotfix1');
versions.push('1.991.1+hotfix2');
versions.push('1.991.2-rc1');
versions.push('1.991.2-rc2');
// versions.push('1.991.2');
versions.push('1.992.2-rc1');
versions.push('1.992.2-rc2');
}
for (let i = 0; i < versions.length; i += 1) {
versions[i] = Lexver.parseVersion(versions[i]);
}
{
let versionsTxt = versions.join('\n');
console.info(versionsTxt);
}
let verPrefix = Lexver.parsePrefix(matchVer);
versions.sort();
versions.reverse();
let selected = Lexver.matchSorted(versions, verPrefix);
console.error(matchVer, verPrefix);
console.error('Selected:', selected);
}
main()
.then(function () {
console.error('');
console.error('Done.');
process.exit(0);
})
.catch(function (e) {
console.error(e.stack);
process.exit(1);
});