From 7dc9d2dd77d0eec476384804635671c04b13bdcf Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 21 Mar 2025 13:44:41 +0300 Subject: [PATCH 1/3] Throw error on invalid suite command --- .../Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs | 3 +++ 1 file changed, 3 insertions(+) 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."); } } From d078e5a059d0b93ea023a08d022ebcb6a4dd499e Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 21 Mar 2025 16:30:47 +0300 Subject: [PATCH 2/3] Update version mismatch warning during solution creation --- .../Cli/ProjectBuilding/AbpIoSourceCodeStore.cs | 17 +++++++++++++---- .../Volo/Abp/Cli/Version/CliVersionService.cs | 5 +++++ 2 files changed, 18 insertions(+), 4 deletions(-) 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..d5036a56b2 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 @@ -131,16 +131,25 @@ public class AbpIoSourceCodeStore : ISourceCodeStore, ITransientDependency } } + Logger.LogWarning(currentCliVersion.ToString()); if (outputWarning) { Logger.LogWarning(userSpecifiedVersion ? $"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) From 60ab0d5d661677370aafb583870e4e6a12968b50 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Fri, 21 Mar 2025 16:33:00 +0300 Subject: [PATCH 3/3] Update AbpIoSourceCodeStore.cs --- .../Volo/Abp/Cli/ProjectBuilding/AbpIoSourceCodeStore.cs | 1 - 1 file changed, 1 deletion(-) 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 d5036a56b2..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 @@ -131,7 +131,6 @@ public class AbpIoSourceCodeStore : ISourceCodeStore, ITransientDependency } } - Logger.LogWarning(currentCliVersion.ToString()); if (outputWarning) { Logger.LogWarning(userSpecifiedVersion