diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-10-02 14:57:52 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-10-02 14:57:52 -0700 |
| commit | d25a072c76ff81934813f20116788140621619ba (patch) | |
| tree | df92a30327c6ecb0664c96afebdaa0433cf443db /toolsrc/src/Paragraphs.cpp | |
| parent | e4e5298911059837652824d47bce1e964305c72d (diff) | |
| download | vcpkg-d25a072c76ff81934813f20116788140621619ba.tar.gz vcpkg-d25a072c76ff81934813f20116788140621619ba.zip | |
Show warning instead of failing if port cannot be parsed
Diffstat (limited to 'toolsrc/src/Paragraphs.cpp')
| -rw-r--r-- | toolsrc/src/Paragraphs.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/Paragraphs.cpp index a7dee4fd3..6a6f191df 100644 --- a/toolsrc/src/Paragraphs.cpp +++ b/toolsrc/src/Paragraphs.cpp @@ -254,7 +254,7 @@ namespace vcpkg::Paragraphs for (auto&& path : fs.get_files_non_recursive(ports_dir)) { auto maybe_spgh = try_load_port(fs, path); - if (auto spgh = maybe_spgh.get()) + if (const auto spgh = maybe_spgh.get()) { ret.paragraphs.emplace_back(std::move(*spgh)); } @@ -272,8 +272,20 @@ namespace vcpkg::Paragraphs auto results = try_load_all_ports(fs, ports_dir); if (!results.errors.empty()) { - print_error_message(results.errors); - Checks::exit_fail(VCPKG_LINE_INFO); + if (GlobalState::debugging) + { + print_error_message(results.errors); + } + else + { + for (auto&& error : results.errors) + { + System::println( + System::Color::warning, "Warning: an error occurred while parsing '%s'", error->name); + } + System::println(System::Color::warning, + "Use '--debug' to get more information about the parse failures.\n"); + } } return std::move(results.paragraphs); } |
