From 4950b1e4f978026089bfe32f2cba35c535ad1892 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Tue, 19 Jan 2021 15:13:18 +0100 Subject: [PATCH] tools/highest-endpoint-version: start with current profile ver [ci skip] --- tools/highest-endpoint-version/cli.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/highest-endpoint-version/cli.js b/tools/highest-endpoint-version/cli.js index 4388526a..a4405360 100755 --- a/tools/highest-endpoint-version/cli.js +++ b/tools/highest-endpoint-version/cli.js @@ -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 ✔︎')