Skip to content

Commit

Permalink
Fix the cmake's output for vcpkg_get_dep_info() (#290)
Browse files Browse the repository at this point in the history
* Fix the cmake's output for vcpkg_get_dep_info()

Set CLICOLOR=0 to force cmake to output "plain" text (without ANSI escape codes)

* Adding a reference link

Should explain the logic behind CLICOLOR and CLICOLOR_FORCE

* Expand the comment

* clang-format

Co-authored-by: Billy Robert O'Neal III <[email protected]>
  • Loading branch information
tlemo and BillyONeal authored Dec 3, 2021
1 parent 1b7edfa commit 678019b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/vcpkg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,16 @@ int main(const int argc, const char* const* const argv)
}
#endif
set_environment_variable("VCPKG_COMMAND", get_exe_path_of_current_process().generic_u8string());

// Prevent child processes (ex. cmake) from producing "colorized"
// output (which may include ANSI escape codes), since it would
// complicate parsing the output.
//
// See http://bixense.com/clicolors for the semantics associated with
// the CLICOLOR and CLICOLOR_FORCE env variables
//
set_environment_variable("CLICOLOR_FORCE", {});
set_environment_variable("CLICOLOR", "0");

Checks::register_global_shutdown_handler([]() {
const auto elapsed_us_inner = GlobalState::timer.microseconds();
Expand Down

0 comments on commit 678019b

Please sign in to comment.