From dfebe4deffbe9abf2601686fafdb831df6624017 Mon Sep 17 00:00:00 2001 From: Roc Date: Tue, 21 Jun 2022 10:55:13 +0800 Subject: [PATCH] Update InstallLibsService.cs --- .../Volo/Abp/Cli/LIbs/InstallLibsService.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/LIbs/InstallLibsService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/LIbs/InstallLibsService.cs index 1ca2ad987b..8aadf21b56 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/LIbs/InstallLibsService.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/LIbs/InstallLibsService.cs @@ -80,13 +80,6 @@ public class InstallLibsService : IInstallLibsService, ITransientDependency // MVC or BLAZOR SERVER if (projectPath.EndsWith(".csproj")) { - var packageJsonFilePath = Path.Combine(Path.GetDirectoryName(projectPath), "package.json"); - - if (!File.Exists(packageJsonFilePath)) - { - continue; - } - if (IsYarnAvailable()) { RunYarn(projectDirectory); @@ -108,8 +101,14 @@ public class InstallLibsService : IInstallLibsService, ITransientDependency .Where(file => ExcludeDirectory.All(x => file.IndexOf(x, StringComparison.OrdinalIgnoreCase) == -1)) .Where(file => { - if (file.EndsWith("csproj")) + if (file.EndsWith(".csproj")) { + var packageJsonFilePath = Path.Combine(Path.GetDirectoryName(file), "package.json"); + if (!File.Exists(packageJsonFilePath)) + { + return false; + } + using (var reader = File.OpenText(file)) { return reader.ReadToEnd().Contains("Microsoft.NET.Sdk.Web");