diff --git a/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs b/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs index 7a4a507df8..09ca4fd5f1 100644 --- a/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs +++ b/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs @@ -31,6 +31,7 @@ public ChocolateyConfiguration() { RegularOuptut = true; PromptForConfirmation = true; + SourceType = SourceType.normal; Information = new InformationCommandConfiguration(); Features = new FeaturesConfiguration(); NewCommand = new NewCommandConfiguration(); @@ -103,6 +104,7 @@ private void output_tostring(StringBuilder propertyValues, IEnumerable public string Sources { get; set; } + public SourceType SourceType { get; set; } // top level commands diff --git a/src/chocolatey/infrastructure.app/runners/GenericRunner.cs b/src/chocolatey/infrastructure.app/runners/GenericRunner.cs index d78835a8c9..faf6a365c2 100644 --- a/src/chocolatey/infrastructure.app/runners/GenericRunner.cs +++ b/src/chocolatey/infrastructure.app/runners/GenericRunner.cs @@ -20,6 +20,7 @@ namespace chocolatey.infrastructure.app.runners using SimpleInjector; using attributes; using configuration; + using domain; using infrastructure.commands; public sealed class GenericRunner @@ -50,6 +51,8 @@ public void run(ChocolateyConfiguration config, Container container, bool isCons parseArgs.Invoke(command); } + set_source_type(config); + this.Log().Debug(() => "Configuration: {0}".format_with(config.ToString())); @@ -78,5 +81,12 @@ public void run(ChocolateyConfiguration config, Container container, bool isCons } } } + + private static void set_source_type(ChocolateyConfiguration config) + { + var sourceType = SourceType.normal; + Enum.TryParse(config.Sources, true, out sourceType); + config.SourceType = sourceType; + } } } \ No newline at end of file