[vcpkg-edit] Open package folders when passed --all
MODIFY
src/vcpkg/commands.edit.cpp
src/vcpkg/commands.edit.cpp
@@ -64,14 +64,29 @@ namespace vcpkg::Commands::Edit
{
if (Util::Sets::contains(options.switches, OPTION_ALL))
{
+ const auto& fs = paths.get_filesystem();
+ auto packages = fs.get_files_non_recursive(paths.packages);
+
return Util::fmap(ports, [&](const std::string& port_name) -> std::string {
const auto portpath = paths.ports / port_name;
const auto portfile = portpath / "portfile.cmake";
const auto buildtrees_current_dir = paths.buildtrees / port_name;
- return Strings::format(R"###("%s" "%s" "%s")###",
+ const auto pattern = port_name + "_";
+
+ std::string package_paths;
+ for (auto&& package : packages)
+ {
+ if (Strings::case_insensitive_ascii_starts_with(package.filename().u8string(), pattern))
+ {
+ package_paths.append(Strings::format(" \"%s\"", package.u8string()));
+ }
+ }
+
+ return Strings::format(R"###("%s" "%s" "%s"%s)###",
portpath.u8string(),
portfile.u8string(),
- buildtrees_current_dir.u8string());
+ buildtrees_current_dir.u8string(),
+ package_paths);
});
}

[vcpkg-edit] Open package folders when passed --all