Skip to content

Commit 25bf34e

Browse files
authored
Move command output to global space (#51)
* Move command output to global space * Upgrade version to 0.2.4
1 parent 1175037 commit 25bf34e

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/config_modal.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ struct WebhookConfigModal
100100
"<p>Path: {{&request.path}}</p>",
101101
"<p>User-Agent: {{#request.header}}user-agent{{/request.header}}</p>",
102102
"<p>Client: {{request.remote_addr}}</p>",
103-
"<p>{{&response.command_output}}</p>"
103+
"<p>{{&command_output}}</p>"
104104
},
105105
},
106106
.command_timeout = 8000,

src/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ int main(int argc, char **argv)
173173
auto rendered_command = kainjow::mustache::mustache{command}.render(context);
174174
auto command_output_future = PlatformHelper::getInstance().executeCommandAsync(rendered_command);
175175
context.set("rendered_command", rendered_command);
176-
response.set("command_output", kainjow::mustache::lambda_t{[&command_output_future, command_timeout](const std::string &)
176+
context.set("command_output", kainjow::mustache::lambda_t{[&command_output_future, command_timeout](const std::string &)
177177
{
178178
if (command_timeout > 0)
179179
{
@@ -195,7 +195,6 @@ int main(int argc, char **argv)
195195
return command_output_future.get();
196196
}
197197
}});
198-
context.set("response", response); // re-assign
199198

200199
kainjow::mustache::mustache content_tmpl{content};
201200
auto result = content_tmpl.render(context);

src/util/version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class VersionHelper
1111
{
1212
VERSION_MAJOR = 0,
1313
VERSION_MINOR = 2,
14-
VERSION_PATCH = 2,
14+
VERSION_PATCH = 4,
1515
};
1616

1717
public:

0 commit comments

Comments
 (0)