1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 09:21:47 +02:00

Improve the config check output for stores that don't know about trust

Make it proper english
This commit is contained in:
Théophane Hufschmitt 2024-04-08 11:02:39 +02:00
parent dea23c3c9b
commit bd8c276ddb
2 changed files with 9 additions and 4 deletions

View file

@ -145,9 +145,14 @@ struct CmdConfigCheck : StoreCommand
void checkTrustedUser(ref<Store> store)
{
auto trustedMay = store->isTrustedClient();
std::string_view trustedness = trustedMay ? (*trustedMay ? "trusted" : "not trusted") : "unknown trust";
checkInfo(fmt("You are %s by store uri: %s", trustedness, store->getUri()));
if (auto trustedMay = store->isTrustedClient()) {
std::string_view trusted = trustedMay.value()
? "trusted"
: "not trusted";
checkInfo(fmt("You are %s by store uri: %s", trusted, store->getUri()));
} else {
checkInfo(fmt("Store uri: %s doesn't have a notion of trusted user", store->getUri()));
}
}
};