mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-02-21 01:42:26 +00:00
os download: Don't append '.prod' if the OS version does not match regex
This commit is contained in:
parent
ae69accf0f
commit
c6a0bc0fba
@ -202,15 +202,15 @@ async function resolveOSVersion(
|
||||
if (['menu', 'menu-esr'].includes(version)) {
|
||||
return await selectOSVersionFromMenu(deviceType, version === 'menu-esr');
|
||||
}
|
||||
if (version[0] === 'v') {
|
||||
version = version.slice(1);
|
||||
}
|
||||
// The version must end with either '.dev' or '.prod', as expected
|
||||
// by `balena-image-manager` and the balena SDK. Note that something
|
||||
// like '2.88.4.prod' is not valid semver (https://semver.org/),
|
||||
// so we don't even attempt semver parsing here.
|
||||
if (!version.endsWith('.dev') && !version.endsWith('.prod')) {
|
||||
version += '.prod';
|
||||
if (/^v?\d+\.\d+\.\d+/.test(version)) {
|
||||
if (version[0] === 'v') {
|
||||
version = version.slice(1);
|
||||
}
|
||||
// The version must end with either '.dev' or '.prod', as expected
|
||||
// by `balena-image-manager` and the balena SDK.
|
||||
if (!version.endsWith('.dev') && !version.endsWith('.prod')) {
|
||||
version += '.prod';
|
||||
}
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user