diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs index d8a3b6d154..48f5eca5f8 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs +++ b/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."); } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs index 5ef3657529..411be841ed 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs +++ b/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) { diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/CliVersionService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/CliVersionService.cs index eb5c13a561..0bb8536162 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Version/CliVersionService.cs +++ b/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)