Browse Source

Merge pull request #23382 from abpframework/issue/23375

Cli: Fix updating leptonx npm package problem
pull/23386/head
Yunus Emre Kalkan 1 year ago
committed by GitHub
parent
commit
829105488a
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs

8
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/NpmPackagesUpdater.cs

@ -210,7 +210,7 @@ public class NpmPackagesUpdater : ITransientDependency
if (!specifiedVersion.IsNullOrWhiteSpace()) if (!specifiedVersion.IsNullOrWhiteSpace())
{ {
if (package.Name.IndexOf("leptonx", StringComparison.InvariantCultureIgnoreCase) > 0 && !specifiedLeptonXVersion.IsNullOrWhiteSpace()) if (IsLeptonXPackage(package) && !specifiedLeptonXVersion.IsNullOrWhiteSpace())
{ {
if (!SpecifiedVersionExists(specifiedLeptonXVersion, package)) if (!SpecifiedVersionExists(specifiedLeptonXVersion, package))
{ {
@ -289,6 +289,12 @@ public class NpmPackagesUpdater : ITransientDependency
return true; return true;
} }
private static bool IsLeptonXPackage(JProperty package)
{
return package.Name.IndexOf("leptonx", StringComparison.InvariantCultureIgnoreCase) > 0
|| package.Name.IndexOf("lepton-x", StringComparison.InvariantCultureIgnoreCase) > 0;
}
protected virtual bool IsPrerelease(string version) protected virtual bool IsPrerelease(string version)
{ {
if (version == null) if (version == null)

Loading…
Cancel
Save