`install`: When package name is invalid, error out earlier and with a better message
Resolves
MODIFY
src/commands_build.cpp
src/commands_build.cpp
@@ -165,7 +165,7 @@ namespace vcpkg::Commands::Build
const Expected<SourceParagraph> maybe_spgh = Paragraphs::try_load_port(paths.get_filesystem(), port_dir);
Checks::check_exit(VCPKG_LINE_INFO,
!maybe_spgh.error_code(),
- "Could not find package named %s: %s",
+ "Could not find package %s: %s",
spec,
maybe_spgh.error_code().message());
const SourceParagraph& spgh = *maybe_spgh.get();

MODIFY
src/vcpkg_Dependencies.cpp
src/vcpkg_Dependencies.cpp
@@ -180,7 +180,7 @@ namespace vcpkg::Dependencies
if (auto spgh = maybe_spgh.get())
return InstallPlanAction{ spec, { nullopt, nullopt, *spgh }, request_type };
- return InstallPlanAction{ spec, { nullopt, nullopt, nullopt }, request_type };
+ Checks::exit_with_message(VCPKG_LINE_INFO, "Could not find package %s", spec);
}
};

`install`: When package name is invalid, error out earlier and with a better message

Resolves #986