public static void ProcessUpdateOptions(UpdateCmdLineOptions options) { try { var type = GetExtensionType(options.Directory); switch (type) { case ItemType.DesktopTheme: Themes.UpdateTheme(options.Directory, ApplicationMode.Desktop); break; case ItemType.FullscreenTheme: Themes.UpdateTheme(options.Directory, ApplicationMode.Desktop); break; case ItemType.Uknown: case ItemType.PowerShellScript: case ItemType.IronPythonScript: case ItemType.GenericPlugin: case ItemType.MetadataPlugin: case ItemType.LibraryPlugin: throw new NotSupportedException(); } } catch (Exception e) when(!Debugger.IsAttached) { logger.Error(e, "Failed to update extension." + Environment.NewLine + e.Message); } }
public static void ProcessUpdateOptions(UpdateCmdLineOptions options) { if (options.Type == ItemType.Theme) { try { var mode = options.TargetType.Equals("desktop", StringComparison.OrdinalIgnoreCase) ? ApplicationMode.Desktop : ApplicationMode.Fullscreen; var sourceDir = Path.Combine(Paths.GetThemesPath(mode), options.Name); UpdateTheme(sourceDir, mode); logger.Info($"Theme successfully updated."); } catch (Exception e) when(!Debugger.IsAttached) { logger.Error(e, "Failed to update theme file." + Environment.NewLine + e.Message); } } }