diff --git a/src/chocolatey/infrastructure.app/runners/GenericRunner.cs b/src/chocolatey/infrastructure.app/runners/GenericRunner.cs index c464a56544..0fd94fac66 100644 --- a/src/chocolatey/infrastructure.app/runners/GenericRunner.cs +++ b/src/chocolatey/infrastructure.app/runners/GenericRunner.cs @@ -104,18 +104,8 @@ now be in a bad state. Only official builds are to be trusted. } } - - if (config.Noop) - { - if (config.RegularOutput) - { - this.Log().Info("_ {0}:{1} - Noop Mode _".format_with(ApplicationParameters.Name, command.GetType().Name)); - } - - command.noop(config); - return null; - } } + return command; } @@ -145,14 +135,25 @@ public void run(ChocolateyConfiguration config, Container container, bool isCons fail_when_license_is_missing_or_invalid_if_requested(config); - EventManager.publish(new PreRunMessage(config)); var command = find_command(config, container, isConsole, parseArgs); if (command != null) { - this.Log().Debug("_ {0}:{1} - Normal Run Mode _".format_with(ApplicationParameters.Name, command.GetType().Name)); - command.run(config); + if (config.Noop) + { + if (config.RegularOutput) + { + this.Log().Info("_ {0}:{1} - Noop Mode _".format_with(ApplicationParameters.Name, command.GetType().Name)); + } + + command.noop(config); + } + else + { + this.Log().Debug("_ {0}:{1} - Normal Run Mode _".format_with(ApplicationParameters.Name, command.GetType().Name)); + command.run(config); + } } EventManager.publish(new PostRunMessage(config));