Browse Source

Improve the `yarn` command detection

pull/12972/head
Charley Wu 4 years ago
parent
commit
a03d9efd07
  1. 11
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/LIbs/InstallLibsService.cs

11
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/LIbs/InstallLibsService.cs

@ -253,17 +253,10 @@ public class InstallLibsService : IInstallLibsService, ITransientDependency
private bool IsYarnAvailable()
{
var output = CmdHelper.RunCmdAndGetOutput("npm list yarn -g --depth 0").Trim();
if (output.Contains("empty"))
{
return false;
}
if (!SemanticVersion.TryParse(output.Substring(output.IndexOf('@') + 1), out var version))
{
var output = CmdHelper.RunCmdAndGetOutput("yarn -v").Trim();
if (!SemanticVersion.TryParse(output, out var version)){
return false;
}
return version > SemanticVersion.Parse("1.20.0");
}
}

Loading…
Cancel
Save