From bac3f3de881df1fe034ab46ae06db8104e94d5cb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 18 Apr 2017 16:03:43 -0700 Subject: `export` if package is not built, fail and suggest to `install` --- toolsrc/src/commands_export.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'toolsrc/src/commands_export.cpp') 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); -- cgit v1.2.3