tools/highest-endpoint-version: start with current profile ver

[ci skip]
This commit is contained in:
Jannis R 2021-01-19 15:13:18 +01:00
parent 02af67e26c
commit 4950b1e4f9
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5

View file

@ -53,7 +53,19 @@ const checkWithVersion = async (version) => {
const silent = argv.silent || argv.s
;(async () => {
for (let minor = 16; minor <= 35; minor++) {
const parseVer = ver => parseInt(ver.split('.')[1])
let baseMinor = 16
if ('string' === typeof profile.ver && profile.ver) {
baseMinor = parseVer(profile.ver)
} else {
const ctx = {opt: {}}
const body = profile.transformReqBody(ctx, {})
if ('string' === typeof body.ver && body.ver) {
baseMinor = parseVer(body.ver)
}
}
for (let minor = baseMinor; minor <= 70; minor++) {
const v = '1.' + minor
if (await checkWithVersion(v)) {
if (!silent) console.log(v + ' is supported ✔︎')