| 76 | namespace fs = std::filesystem; |
| 77 | |
| 78 | static auto executeScript(const std::string & command, bool throw_on_error = false) |
| 79 | { |
| 80 | auto sh = ShellCommand::execute(command); |
| 81 | WriteBufferFromFileDescriptor wb_stdout(STDOUT_FILENO); |
| 82 | WriteBufferFromFileDescriptor wb_stderr(STDERR_FILENO); |
| 83 | copyData(sh->out, wb_stdout); |
| 84 | copyData(sh->err, wb_stderr); |
| 85 | |
| 86 | if (throw_on_error) |
| 87 | { |
| 88 | sh->wait(); |
| 89 | return 0; |
| 90 | } |
| 91 | else |
| 92 | return sh->tryWait(); |
| 93 | } |
| 94 | |
| 95 | static bool filesEqual(std::string path1, std::string path2) |
| 96 | { |