diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-11-09 10:29:59 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2018-11-09 10:29:59 +0100 |
commit | 220c79ec22ea71f89f3b2aeb84b77c022e89f5e5 (patch) | |
tree | e514605342db2690a0875347bfdd88c64a555f70 | |
parent | 4ea4d0b1a39deb0f12a66e10e4809f2d0ddb324e (diff) | |
parent | 9d24b5d56e024b51240fe1010810f1c343de01ff (diff) |
Merge branch 'feature/prefetch-progress' of https://github.com/dtzWill/nix
-rw-r--r-- | src/nix-prefetch-url/nix-prefetch-url.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nix-prefetch-url/nix-prefetch-url.cc b/src/nix-prefetch-url/nix-prefetch-url.cc index ddb724913..54a402241 100644 --- a/src/nix-prefetch-url/nix-prefetch-url.cc +++ b/src/nix-prefetch-url/nix-prefetch-url.cc @@ -7,6 +7,8 @@ #include "common-eval-args.hh" #include "attr-path.hh" #include "legacy.hh" +#include "finally.hh" +#include "progress-bar.hh" #include <iostream> @@ -96,6 +98,11 @@ static int _main(int argc, char * * argv) if (args.size() > 2) throw UsageError("too many arguments"); + Finally f([]() { stopProgressBar(); }); + + if (isatty(STDERR_FILENO)) + startProgressBar(); + auto store = openStore(); auto state = std::make_unique<EvalState>(myArgs.searchPath, store); |