diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-18 16:03:43 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-21 18:06:52 -0700 |
| commit | bac3f3de881df1fe034ab46ae06db8104e94d5cb (patch) | |
| tree | 241a23749515da90cfce688c1a807081e5af485e /toolsrc/src/commands_export.cpp | |
| parent | 6350eddd4689568ff8dcfe431e1bf81579fb0556 (diff) | |
| download | vcpkg-bac3f3de881df1fe034ab46ae06db8104e94d5cb.tar.gz vcpkg-bac3f3de881df1fe034ab46ae06db8104e94d5cb.zip | |
`export` if package is not built, fail and suggest to `install`
Diffstat (limited to 'toolsrc/src/commands_export.cpp')
| -rw-r--r-- | toolsrc/src/commands_export.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/toolsrc/src/commands_export.cpp b/toolsrc/src/commands_export.cpp index 018c6d636..0c403d04e 100644 --- a/toolsrc/src/commands_export.cpp +++ b/toolsrc/src/commands_export.cpp @@ -83,6 +83,16 @@ namespace vcpkg::Commands::Export System::println(System::Color::warning, "Additional packages (*) need to be exported to complete this operation."); } + auto it = group_by_plan_type.find(ExportPlanType::PORT_AVAILABLE_BUT_NOT_BUILT); + if (it != group_by_plan_type.cend() && !it->second.empty()) + { + System::println(System::Color::error, "There are packages that have not been built."); + auto s = Strings::join(" ", specs, [](const PackageSpec& spec) { return spec.to_string(); }); + System::println("To build them, run:\n" + " vcpkg install %s", s); + Checks::exit_fail(VCPKG_LINE_INFO); + } + if (dryRun) { Checks::exit_success(VCPKG_LINE_INFO); @@ -97,6 +107,11 @@ namespace vcpkg::Commands::Export // execute the plan for (const ExportPlanAction& action : export_plan) { + if (action.plan_type != ExportPlanType::ALREADY_BUILT) + { + Checks::unreachable(VCPKG_LINE_INFO); + } + const std::string display_name = action.spec.to_string(); System::println("Exporting package %s... ", display_name); |
