private static TemplatesSourceConfig GetConfig(RemoteSourceListOptions options, TextWriter output) { if (options.Build) { output.WriteCommandText("Building Remote Templates Source Configuration information..."); return(RemoteSource.GetTemplatesSourceConfig(options.StorageAccount, options.Env)); } else { output.WriteCommandText("Getting config file from the CDN (config.json)..."); return(GetConfigFromCdn(options.Env)); } }
public static int List(RemoteSourceListOptions listOpts, TextWriter output, TextWriter error) { if (listOpts.Summary && !listOpts.Detailed) { RemoteSourceWorker.ListSummaryInfo(listOpts, output, error); } if (listOpts.Detailed) { RemoteSourceWorker.ListDetailedVersions(listOpts, output, error); } return(0); }
public static void ListSummaryInfo(RemoteSourceListOptions options, TextWriter output, TextWriter error) { try { output.WriteCommandHeader($"Summary Info for environment {options.Env.ToString()} ({options.StorageAccount})"); TemplatesSourceConfig config = GetConfig(options, output); output.WriteLine(); WriteSummary(config, output); } catch (Exception ex) { error.WriteException(ex, $"Unable to list remote source info from enviorment {options.Env.ToString()} (storage account: {options.StorageAccount})."); } }