Skip to content

Commit

Permalink
automatic: Substitute variables in command_format
Browse files Browse the repository at this point in the history
{body} was not substituted correctly in `command_format` for the command
emitter.

Resolves #1951
  • Loading branch information
evan-goode committed Dec 20, 2024
1 parent d51f614 commit 9035d53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dnf5-plugins/automatic_plugin/emitters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ std::string quote(std::string_view str) {

void EmitterCommand::notify() {
std::string command_format = config_automatic.config_command.command_format.get_value();
std::string command = libdnf5::utils::sformat(command_format, fmt::arg("body", quote(output_stream.str())));

FILE * command_pipe = popen(command_format.c_str(), "w");
FILE * command_pipe = popen(command.c_str(), "w");
if (command_pipe) {
std::string stdin_format = config_automatic.config_command.stdin_format.get_value();
fputs(libdnf5::utils::sformat(stdin_format, fmt::arg("body", output_stream.str())).c_str(), command_pipe);
Expand Down

0 comments on commit 9035d53

Please sign in to comment.