Flush std::cout before launching external process

This commit is contained in:
Alexander Karatarakis 2017-02-14 19:09:09 -08:00
parent 9dac4b073a
commit 4d29741fcb

View File

@ -14,6 +14,9 @@ namespace vcpkg::System
int cmd_execute(const wchar_t* cmd_line)
{
// Flush cout before launching external process
std::cout << std::flush;
// Basically we are wrapping it in quotes
const std::wstring& actual_cmd_line = Strings::wformat(LR"###("%s")###", cmd_line);
int exit_code = _wsystem(actual_cmd_line.c_str());
@ -22,6 +25,9 @@ namespace vcpkg::System
exit_code_and_output cmd_execute_and_capture_output(const wchar_t* cmd_line)
{
// Flush cout before launching external process
std::cout << std::flush;
const std::wstring& actual_cmd_line = Strings::wformat(LR"###("%s")###", cmd_line);
std::string output;