1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-30 06:01:00 +01:00

nix store sign: Use required attribute

This commit is contained in:
Eelco Dolstra 2025-10-16 15:11:47 +02:00
parent 139df77440
commit 3bd2b76f6e

View file

@ -104,6 +104,7 @@ struct CmdSign : StorePathsCommand
.labels = {"file"}, .labels = {"file"},
.handler = {&secretKeyFile}, .handler = {&secretKeyFile},
.completer = completePath, .completer = completePath,
.required = true,
}); });
} }
@ -114,9 +115,6 @@ struct CmdSign : StorePathsCommand
void run(ref<Store> store, StorePaths && storePaths) override void run(ref<Store> store, StorePaths && storePaths) override
{ {
if (secretKeyFile.empty())
throw UsageError("you must specify a secret key file using '-k'");
SecretKey secretKey(readFile(secretKeyFile)); SecretKey secretKey(readFile(secretKeyFile));
LocalSigner signer(std::move(secretKey)); LocalSigner signer(std::move(secretKey));