mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 07:19:08 +08:00
export
if package is not built, fail and suggest to install
This commit is contained in:
parent
6350eddd46
commit
bac3f3de88
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user