mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-27 22:59:02 +08:00
[vcpkg] Show Empty Object on vcpkg --list when used with --x-json (#13667)
Thanks to @strega-nil for recommending using Json::stringify over my initial idea of simply printing an empty object Closes #13637
This commit is contained in:
parent
2a9225b422
commit
3031f78ddd
@ -95,7 +95,10 @@ namespace vcpkg::Commands::List
|
||||
|
||||
if (installed_ipv.empty())
|
||||
{
|
||||
System::print2("No packages are installed. Did you mean `search`?\n");
|
||||
if (args.output_json())
|
||||
System::print2(Json::stringify(Json::Object(), {}));
|
||||
else
|
||||
System::print2("No packages are installed. Did you mean `search`?\n");
|
||||
Checks::exit_success(VCPKG_LINE_INFO);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user