Merge pull request #9307 from flox/tomberek.nix_key_newline

nix key: no need for progressBar
This commit is contained in:
Eelco Dolstra authored and GitHub committed 2023-11-16 15:05:34 +01:00
commit 16c052e4e7
2 files changed
+5

No files matched your search

+2
View File
@@ -1,6 +1,7 @@
#include "command.hh"
#include "store-api.hh"
#include "nar-accessor.hh"
#include "progress-bar.hh"
using namespace nix;
@@ -13,6 +14,7 @@ struct MixCat : virtual Args
auto st = accessor->lstat(CanonPath(path));
if (st.type != SourceAccessor::Type::tRegular)
throw Error("path '%1%' is not a regular file", path);
stopProgressBar();
writeFull(STDOUT_FILENO, accessor->readFile(CanonPath(path)));
}
};
+3
View File
@@ -3,6 +3,7 @@
#include "shared.hh"
#include "store-api.hh"
#include "thread-pool.hh"
#include "progress-bar.hh"
#include <atomic>
@@ -174,6 +175,7 @@ struct CmdKeyGenerateSecret : Command
if (!keyName)
throw UsageError("required argument '--key-name' is missing");
stopProgressBar();
writeFull(STDOUT_FILENO, SecretKey::generate(*keyName).to_string());
}
};
@@ -195,6 +197,7 @@ struct CmdKeyConvertSecretToPublic : Command
void run() override
{
SecretKey secretKey(drainFD(STDIN_FILENO));
stopProgressBar();
writeFull(STDOUT_FILENO, secretKey.toPublicKey().to_string());
}
};