Browse Source

Merge pull request #22422 from abpframework/cli-improvements-21-03-25

Update version mismatch warning during solution creation
pull/22423/head
Yunus Emre Kalkan 2 years ago
committed by GitHub
parent
commit
552f422b39
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs
  2. 16
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs
  3. 5
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/CliVersionService.cs

3
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs

@ -107,6 +107,9 @@ public class SuiteCommand : IConsoleCommand, ITransientDependency
Logger.LogInformation("Removing ABP Suite...");
RemoveSuite();
break;
default:
throw new CliUsageException("Invalid Suite command! Run \"abp help suite\" command to see available Suite commands.");
}
}

16
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs

@ -137,10 +137,18 @@ public class AbpIoSourceCodeStore : ISourceCodeStore, ITransientDependency
? $"The specified template version ({templateVersion}) is different than the CLI version ({currentCliVersion}). This may cause compatibility issues."
: $"The latest template version ({templateVersion}) is different than the CLI version ({currentCliVersion}). This may cause compatibility issues.");
Logger.LogWarning("Please upgrade/downgrade the CLI version to the template version.");
Logger.LogWarning($"> dotnet tool uninstall -g volo.abp.cli");
Logger.LogWarning(!templateVersion.IsPrerelease
? $"> dotnet tool install -g volo.abp.cli --version \"{templateVersion.Major}.{templateVersion.Minor}.*\""
: $"> dotnet tool install -g volo.abp.cli --version {templateVersion}");
if (currentCliVersion.ToString().EndsWith("-studio"))
{
Logger.LogWarning($"> abp install-old-cli --version {templateVersion}");
}
else
{
Logger.LogWarning($"> dotnet tool uninstall -g volo.abp.cli");
Logger.LogWarning(!templateVersion.IsPrerelease
? $"> dotnet tool install -g volo.abp.cli --version \"{templateVersion.Major}.{templateVersion.Minor}.*\""
: $"> dotnet tool install -g volo.abp.cli --version {templateVersion}");
}
if (userSpecifiedVersion)
{

5
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/CliVersionService.cs

@ -34,6 +34,11 @@ public class CliVersionService : ITransientDependency
break;
}
if (line.StartsWith("volo.abp.studio.cli", StringComparison.InvariantCultureIgnoreCase))
{
var assemblyVersion = string.Join(".", Assembly.GetExecutingAssembly().GetFileVersion().Split('.').Take(3));
return SemanticVersion.Parse(assemblyVersion + "-studio");
}
}
if (currentCliVersion == null)

Loading…
Cancel
Save