Skip to content

Commit

Permalink
key and cat: no need for progressBar
Browse files Browse the repository at this point in the history
otherwise the output will be invisible in common terminal configurations
  • Loading branch information
tomberek committed Nov 12, 2023
1 parent 28dddde commit 0be84c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/nix/cat.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "command.hh"
#include "store-api.hh"
#include "nar-accessor.hh"
#include "progress-bar.hh"

using namespace nix;

Expand All @@ -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)));
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/nix/sigs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "shared.hh"
#include "store-api.hh"
#include "thread-pool.hh"
#include "progress-bar.hh"

#include <atomic>

Expand Down Expand Up @@ -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());
}
};
Expand All @@ -195,6 +197,7 @@ struct CmdKeyConvertSecretToPublic : Command
void run() override
{
SecretKey secretKey(drainFD(STDIN_FILENO));
stopProgressBar();
writeFull(STDOUT_FILENO, secretKey.toPublicKey().to_string());
}
};
Expand Down

0 comments on commit 0be84c8

Please sign in to comment.