import * as semver from 'semver' ; import { IActionContext } from 'vscode-azureextensionui' ; import { FuncVersion , getMajorVersion } from "../FuncVersion" ; import { getLocalFuncCoreToolsVersion } from './getLocalFuncCoreToolsVersion' ; export async function hasMinFuncCliVersion ( context , minVersion , projectVersion ) { const majorVersion = getMajorVersion ( projectVersion ) ; if ( semver . gtr ( minVersion , majorVersion ) ) { return false ; } else if ( semver . ltr ( minVersion , majorVersion ) ) { return true ; } else { try { const localCliVersion = await getLocalFuncCoreToolsVersion ( context , undefined ) ; if ( localCliVersion ) { return semver . gte ( localCliVersion , minVersion ) ; } } catch { } return true ; } }