From 15f0ff62f5361e21be5c41aedc0ae0dd3496dd50 Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" Date: Tue, 22 Jul 2025 17:55:12 +0100 Subject: [PATCH] Improve output when we know input --- dist/index.js | 20 +++++++++++++++----- src/setup-beam.js | 20 +++++++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/dist/index.js b/dist/index.js index c77e31c5..c58113c0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -26066,11 +26066,21 @@ async function getOTPVersion(otpSpec0, osVersion) { } function requestedVersionFor(tool, version, originListing, mirrors) { - return ( - `Requested ${tool} version (${version}) not found in version list, ` + - `at ${originListing}${mirrors ? `, with mirrors ${mirrors}` : ''}; ` + - "should you be using option 'version-type': 'strict'?" - ) + const isStrictVersion = isStrictVersion() + + let versionType = 'loose' + if (isStrictVersion) { + versionType = 'strict' + } + + let ret = + `Requested ${versionType} ${tool} version (${version}) not found in version list, ` + + `at ${originListing}${mirrors ? `, with mirrors ${mirrors}` : ''}.` + if (!isStrictVersion) { + ret = `${ret} Should you be using option 'version-type': 'strict'?` + } + + return ret } const knownBranches = ['main', 'master', 'maint'] diff --git a/src/setup-beam.js b/src/setup-beam.js index 73e65c08..5b3a9bbd 100644 --- a/src/setup-beam.js +++ b/src/setup-beam.js @@ -191,11 +191,21 @@ async function getOTPVersion(otpSpec0, osVersion) { } function requestedVersionFor(tool, version, originListing, mirrors) { - return ( - `Requested ${tool} version (${version}) not found in version list, ` + - `at ${originListing}${mirrors ? `, with mirrors ${mirrors}` : ''}; ` + - "should you be using option 'version-type': 'strict'?" - ) + const isStrictVersion = isStrictVersion() + + let versionType = 'loose' + if (isStrictVersion) { + versionType = 'strict' + } + + let ret = + `Requested ${versionType} ${tool} version (${version}) not found in version list, ` + + `at ${originListing}${mirrors ? `, with mirrors ${mirrors}` : ''}.` + if (!isStrictVersion) { + ret = `${ret} Should you be using option 'version-type': 'strict'?` + } + + return ret } const knownBranches = ['main', 'master', 'maint']