mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-24 19:43:33 +01:00
System::cmd_execute_and_capture_output() now redirects std::err to std::out
This commit is contained in:
parent
2d94b2198a
commit
d02d602090
@ -57,7 +57,7 @@ namespace vcpkg::Commands::PortsDiff
|
|||||||
{
|
{
|
||||||
static const std::string VALID_COMMIT_OUTPUT = "commit\n";
|
static const std::string VALID_COMMIT_OUTPUT = "commit\n";
|
||||||
|
|
||||||
const std::wstring cmd = Strings::wformat(LR"("%s" cat-file -t %s 2>NUL)", git_exe.native(), git_commit_id);
|
const std::wstring cmd = Strings::wformat(LR"("%s" cat-file -t %s)", git_exe.native(), git_commit_id);
|
||||||
const System::exit_code_and_output output = System::cmd_execute_and_capture_output(cmd);
|
const System::exit_code_and_output output = System::cmd_execute_and_capture_output(cmd);
|
||||||
Checks::check_exit(output.output == VALID_COMMIT_OUTPUT, "Invalid commit id %s", Strings::utf16_to_utf8(git_commit_id));
|
Checks::check_exit(output.output == VALID_COMMIT_OUTPUT, "Invalid commit id %s", Strings::utf16_to_utf8(git_commit_id));
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ namespace vcpkg::System
|
|||||||
// Flush stdout before launching external process
|
// Flush stdout before launching external process
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
const std::wstring& actual_cmd_line = Strings::wformat(LR"###("%s")###", cmd_line);
|
const std::wstring& actual_cmd_line = Strings::wformat(LR"###("%s 2>&1")###", cmd_line);
|
||||||
|
|
||||||
std::string output;
|
std::string output;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
@ -12,7 +12,7 @@ namespace vcpkg
|
|||||||
{
|
{
|
||||||
static const std::regex re(R"###((\d+)\.(\d+)\.(\d+))###");
|
static const std::regex re(R"###((\d+)\.(\d+)\.(\d+))###");
|
||||||
|
|
||||||
auto rc = System::cmd_execute_and_capture_output(Strings::wformat(LR"(%s 2>&1)", version_cmd));
|
auto rc = System::cmd_execute_and_capture_output(Strings::wformat(LR"(%s)", version_cmd));
|
||||||
if (rc.exit_code != 0)
|
if (rc.exit_code != 0)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -55,7 +55,7 @@ namespace vcpkg
|
|||||||
|
|
||||||
static std::vector<fs::path> find_from_PATH(const std::wstring& name)
|
static std::vector<fs::path> find_from_PATH(const std::wstring& name)
|
||||||
{
|
{
|
||||||
const std::wstring cmd = Strings::wformat(L"where.exe %s 2>&1", name);
|
const std::wstring cmd = Strings::wformat(L"where.exe %s", name);
|
||||||
auto out = System::cmd_execute_and_capture_output(cmd);
|
auto out = System::cmd_execute_and_capture_output(cmd);
|
||||||
if (out.exit_code != 0)
|
if (out.exit_code != 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user