diff --git a/src/Commands/Base/AbstractCommand.cs b/src/Commands/Base/AbstractCommand.cs index 2c9f73c..4ebda89 100644 --- a/src/Commands/Base/AbstractCommand.cs +++ b/src/Commands/Base/AbstractCommand.cs @@ -54,7 +54,7 @@ public virtual Task PreExecute(ToolProfile? profile, string? action) /// - /// A handler which can be assigned to to handler errors. + /// A handler which can be assigned to to handle errors. /// protected void ErrorDataReceived(object sender, DataReceivedEventArgs e) { @@ -80,7 +80,7 @@ protected void LogError(string message, Process? process = null) } - protected void PrintCurrentProfile(ToolProfile? profile) + protected static void PrintCurrentProfile(ToolProfile? profile) { AnsiConsole.Write(new Rule("Current profile:") { Justification = Justify.Left }); AnsiConsole.MarkupLineInterpolated($"Name: [{Constants.EMPHASIS_COLOR}]{profile?.ProjectName ?? "None"}[/]"); diff --git a/src/Commands/SettingsCommand.cs b/src/Commands/SettingsCommand.cs index 26bc6f1..2f8ae9c 100644 --- a/src/Commands/SettingsCommand.cs +++ b/src/Commands/SettingsCommand.cs @@ -258,7 +258,7 @@ private async Task TryUpdateHeadlessOption(CmsHeadlessConfiguration headle } - private string? Truncate(string? value, int maxLength, string truncationSuffix = "...") => value?.Length > maxLength + private static string? Truncate(string? value, int maxLength, string truncationSuffix = "...") => value?.Length > maxLength ? value[..maxLength] + truncationSuffix : value; } diff --git a/src/Services/AppSettingsManager.cs b/src/Services/AppSettingsManager.cs index cfc41a0..b6663e3 100644 --- a/src/Services/AppSettingsManager.cs +++ b/src/Services/AppSettingsManager.cs @@ -78,10 +78,10 @@ public async Task SetKeyValue(ToolProfile? profile, string keyName, object value } - private string GetAppSettingsPath(ToolProfile profile) => $"{profile.WorkingDirectory}/appsettings.json"; + private static string GetAppSettingsPath(ToolProfile profile) => $"{profile.WorkingDirectory}/appsettings.json"; - private Task LoadSettings(ToolProfile? profile) + private static Task LoadSettings(ToolProfile? profile) { if (profile is null) { @@ -92,7 +92,7 @@ private Task LoadSettings(ToolProfile? profile) } - private async Task LoadSettingsInternal(ToolProfile profile) + private static async Task LoadSettingsInternal(ToolProfile profile) { string settingsPath = GetAppSettingsPath(profile); if (!File.Exists(settingsPath)) @@ -106,7 +106,7 @@ private async Task LoadSettingsInternal(ToolProfile profile) } - private Task WriteAppSettings(ToolProfile? profile, JObject appSettings) + private static Task WriteAppSettings(ToolProfile? profile, JObject appSettings) { if (profile is null) { @@ -117,7 +117,7 @@ private Task WriteAppSettings(ToolProfile? profile, JObject appSettings) } - private async Task WriteAppSettingsInternal(ToolProfile profile, JObject appSettings) + private static async Task WriteAppSettingsInternal(ToolProfile profile, JObject appSettings) { string settingsPath = GetAppSettingsPath(profile); diff --git a/src/Services/ConfigManager.cs b/src/Services/ConfigManager.cs index 6b250cc..0ea26f7 100644 --- a/src/Services/ConfigManager.cs +++ b/src/Services/ConfigManager.cs @@ -2,6 +2,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; + using Xperience.Manager.Configuration; using Xperience.Manager.Options; @@ -139,9 +140,9 @@ private async Task MigrateConfig(Version toolVersion) string text = await File.ReadAllTextAsync(Constants.CONFIG_FILENAME); var json = JsonConvert.DeserializeObject(text) ?? throw new InvalidOperationException("Unable to read configuration file for migration."); - if ((config.Version?.ToString().Equals("4.0.0.0") ?? false) && toolVersion.ToString().Equals("4.1.0.0")) + if ((config.Version?.ToString().Equals("4.0.0.0") ?? false) && toolVersion.ToString().Equals("5.0.0.0")) { - Migrate40To41(json, config); + Migrate40To50(json, config); } config.Version = toolVersion; @@ -176,7 +177,7 @@ private static Task WriteConfig(ToolConfiguration config) => File.WriteAllTextAsync(Constants.CONFIG_FILENAME, JsonConvert.SerializeObject(config, Formatting.Indented)); - private static void Migrate40To41(JObject oldConfig, ToolConfiguration newConfig) + private static void Migrate40To50(JObject oldConfig, ToolConfiguration newConfig) { var oldInstallOptions = oldConfig["DefaultInstallOptions"]; diff --git a/src/Services/ScriptBuilder.cs b/src/Services/ScriptBuilder.cs index 908d584..42a2e59 100644 --- a/src/Services/ScriptBuilder.cs +++ b/src/Services/ScriptBuilder.cs @@ -277,11 +277,13 @@ public enum ScriptType /// ResignMacros, + /// /// The script which generates code files for Xperience objects. /// GenerateCode, + /// /// The script which deletes a local folder and its contents. /// @@ -293,11 +295,13 @@ public enum ScriptType /// ExecuteSql, + /// /// The script which uninstalls the Kentico.Xperience.DbManager global tool. /// UninstallDatabaseTool, + /// /// The script which installs the Kentico.Xperience.DbManager global tool. /// diff --git a/src/Wizards/Base/IWizard.cs b/src/Wizards/Base/IWizard.cs index 75461f0..6e79918 100644 --- a/src/Wizards/Base/IWizard.cs +++ b/src/Wizards/Base/IWizard.cs @@ -21,14 +21,14 @@ public interface IWizard where TOptions : IWizardOptions /// Initializes the with the s required to /// populate the . /// - /// Optional arguments to pass to the step initialization. + /// Optional arguments to pass to the step initialization. public Task InitSteps(params string[] args); /// /// Requests user input to generate the . /// - /// Optional arguments to pass to the wizard. + /// Optional arguments to pass to the wizard. public Task Run(params string[] args); } }