Skip to content

Commit a2d0ab6

Browse files
evan-goodeppisar
authored andcommitted
automatic: Substitute variables in command_format
{body} was not substituted correctly in `command_format` for the command emitter. Resolves #1951
1 parent d51f614 commit a2d0ab6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dnf5-plugins/automatic_plugin/emitters.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@ std::string quote(std::string_view str) {
117117

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

121-
FILE * command_pipe = popen(command_format.c_str(), "w");
122+
FILE * command_pipe = popen(command.c_str(), "w");
122123
if (command_pipe) {
123124
std::string stdin_format = config_automatic.config_command.stdin_format.get_value();
124125
fputs(libdnf5::utils::sformat(stdin_format, fmt::arg("body", output_stream.str())).c_str(), command_pipe);

0 commit comments

Comments
 (0)