Skip to content

Commit

Permalink
fixed issue with alpine build;
Browse files Browse the repository at this point in the history
  • Loading branch information
Tino Rusch committed Oct 20, 2016
1 parent 30018a2 commit be9caa6
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions sources/ShellComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,13 @@ void Susi::ShellComponent::handleExec(std::string command, std::string &stdin,
std::string &stdout, std::string &stderr,
int &status) {
std::cout << "executing command: " << command << std::endl;
Process proc("bash", "",
[&stdout](const char *bytes, size_t n) {
stdout += std::string(bytes, n);
},
[&stderr](const char *bytes, size_t n) {
stderr += std::string(bytes, n);
},
true);
std::string *out = &stdout;
std::string *err = &stderr;
Process proc(
"bash", "",
[out](const char *bytes, size_t n) { *out += std::string(bytes, n); },
[err](const char *bytes, size_t n) { *err += std::string(bytes, n); },
true);
proc.write(command + "\n");
proc.write(stdin);
proc.close_stdin();
Expand Down

0 comments on commit be9caa6

Please sign in to comment.