From 1a1cc0948565eb81050eed3ec7630c3ceff7f130 Mon Sep 17 00:00:00 2001 From: yrimal Date: Fri, 5 Jan 2024 14:42:34 -0500 Subject: [PATCH] #596 fix issue with semver validation for latest versions --- src/fn/upload-app-settings.js | 2 +- src/lib/get-api-version.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fn/upload-app-settings.js b/src/fn/upload-app-settings.js index 0e5d1e0ef..5758a762b 100644 --- a/src/fn/upload-app-settings.js +++ b/src/fn/upload-app-settings.js @@ -39,7 +39,7 @@ async function augmentDeclarativeWithNoolsBoilerplate(appSettings) { } const actualCoreVersion = await getValidApiVersion(appSettings); - const addNoolsBoilerplate = semver.lt(actualCoreVersion, '4.2.0-dev'); + const addNoolsBoilerplate = actualCoreVersion && semver.lt(actualCoreVersion, '4.2.0-dev'); if (addNoolsBoilerplate) { appSettings.tasks.rules = nools.addBoilerplateToCode(appSettings.tasks.rules); diff --git a/src/lib/get-api-version.js b/src/lib/get-api-version.js index 7e5cffcf4..410957cc0 100644 --- a/src/lib/get-api-version.js +++ b/src/lib/get-api-version.js @@ -18,7 +18,7 @@ const getApiVersion = async () => { }; const getValidApiVersion = async () => { - return semver.valid(await getApiVersion()); + return semver.valid(semver.coerce(await getApiVersion())); }; module.exports = { getValidApiVersion };