-------------------------------------------------------------------------
| 58 | |
| 59 | //------------------------------------------------------------------------- |
| 60 | std::string RunProcess(const fs::path& program, |
| 61 | const std::vector<std::string>& args) |
| 62 | { |
| 63 | Poco::Pipe outPipe; |
| 64 | auto handle = Poco::Process::launch( |
| 65 | program.string(), args, nullptr, &outPipe, nullptr); |
| 66 | Poco::PipeInputStream istr(outPipe); |
| 67 | std::string content{std::istreambuf_iterator<char>(istr), |
| 68 | std::istreambuf_iterator<char>()}; |
| 69 | |
| 70 | int exitCode = handle.wait(); |
| 71 | if (exitCode) |
| 72 | throw std::runtime_error("Error when running: " + program.string() + |
| 73 | " " + content); |
| 74 | return content; |
| 75 | } |
| 76 | |
| 77 | //------------------------------------------------------------------------ - |
| 78 | fs::path GetVisualStudioPath() |
no outgoing calls