public static void ProcessPackOptions(PackCmdLineOptions options) { try { var outPath = string.Empty; var type = GetExtensionType(options.Directory); switch (type) { case ItemType.DesktopTheme: outPath = Themes.PackageTheme(options.Directory, options.Destination, ApplicationMode.Desktop); break; case ItemType.FullscreenTheme: outPath = Themes.PackageTheme(options.Directory, options.Destination, ApplicationMode.Fullscreen); break; case ItemType.PowerShellScript: case ItemType.IronPythonScript: case ItemType.GenericPlugin: case ItemType.MetadataPlugin: case ItemType.LibraryPlugin: outPath = Extensions.PackageExtension(options.Directory, options.Destination); break; case ItemType.Uknown: throw new NotSupportedException(); } logger.Info($"{type} successfully packed as \"{outPath}\""); } catch (Exception e) when(!Debugger.IsAttached) { logger.Error(e, $"Failed to pack extension." + Environment.NewLine + e.Message); } }
public static void ProcessPackOptions(PackCmdLineOptions 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); var path = PackageTheme(sourceDir, options.DestinationPath, mode); logger.Info($"Theme successfully packed in \"{path}\""); } catch (Exception e) { logger.Error(e, "Failed to pack theme file." + Environment.NewLine + e.Message); } } }