mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 07:46:21 +02:00
key and cat: no need for progressBar
otherwise the output will be invisible in common terminal configurations
This commit is contained in:
parent
28dddde0ac
commit
0be84c83b2
2 changed files with 5 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include "command.hh"
|
#include "command.hh"
|
||||||
#include "store-api.hh"
|
#include "store-api.hh"
|
||||||
#include "nar-accessor.hh"
|
#include "nar-accessor.hh"
|
||||||
|
#include "progress-bar.hh"
|
||||||
|
|
||||||
using namespace nix;
|
using namespace nix;
|
||||||
|
|
||||||
|
@ -13,6 +14,7 @@ struct MixCat : virtual Args
|
||||||
auto st = accessor->lstat(CanonPath(path));
|
auto st = accessor->lstat(CanonPath(path));
|
||||||
if (st.type != SourceAccessor::Type::tRegular)
|
if (st.type != SourceAccessor::Type::tRegular)
|
||||||
throw Error("path '%1%' is not a regular file", path);
|
throw Error("path '%1%' is not a regular file", path);
|
||||||
|
stopProgressBar();
|
||||||
writeFull(STDOUT_FILENO, accessor->readFile(CanonPath(path)));
|
writeFull(STDOUT_FILENO, accessor->readFile(CanonPath(path)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "shared.hh"
|
#include "shared.hh"
|
||||||
#include "store-api.hh"
|
#include "store-api.hh"
|
||||||
#include "thread-pool.hh"
|
#include "thread-pool.hh"
|
||||||
|
#include "progress-bar.hh"
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
|
@ -174,6 +175,7 @@ struct CmdKeyGenerateSecret : Command
|
||||||
if (!keyName)
|
if (!keyName)
|
||||||
throw UsageError("required argument '--key-name' is missing");
|
throw UsageError("required argument '--key-name' is missing");
|
||||||
|
|
||||||
|
stopProgressBar();
|
||||||
writeFull(STDOUT_FILENO, SecretKey::generate(*keyName).to_string());
|
writeFull(STDOUT_FILENO, SecretKey::generate(*keyName).to_string());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -195,6 +197,7 @@ struct CmdKeyConvertSecretToPublic : Command
|
||||||
void run() override
|
void run() override
|
||||||
{
|
{
|
||||||
SecretKey secretKey(drainFD(STDIN_FILENO));
|
SecretKey secretKey(drainFD(STDIN_FILENO));
|
||||||
|
stopProgressBar();
|
||||||
writeFull(STDOUT_FILENO, secretKey.toPublicKey().to_string());
|
writeFull(STDOUT_FILENO, secretKey.toPublicKey().to_string());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue