Skip to content

Commit

Permalink
(maint) move noop run
Browse files Browse the repository at this point in the history
Having noop process in find_command feels incorrect. Move it back over
to run.
  • Loading branch information
ferventcoder committed Aug 7, 2016
1 parent a7bd18a commit 996ba5a
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/chocolatey/infrastructure.app/runners/GenericRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 996ba5a

Please sign in to comment.