diff options
author | Naïm Favier <n@monade.li> | 2022-05-11 12:55:31 +0200 |
---|---|---|
committer | Naïm Favier <n@monade.li> | 2022-05-11 12:58:45 +0200 |
commit | 1461e6cdda06f7f461114cce5b415f6d50381311 (patch) | |
tree | 09b6f1a0b61897486a517f4388c46c951f9d9c19 /src/nix/main.cc | |
parent | 7062ebf5beb62b069dbf7e83f9c0dd92cf999cd3 (diff) |
Stop the logger properly in legacy commands
Ensures the logger is stopped on exit in legacy commands. Without this,
when using `nix-build --log-format bar` and stopping nix with CTRL+C,
the bar is not cleared from the screen.
Diffstat (limited to 'src/nix/main.cc')
-rw-r--r-- | src/nix/main.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nix/main.cc b/src/nix/main.cc index 6d0f6ce6e..dadb54306 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -261,6 +261,8 @@ void mainWrapped(int argc, char * * argv) } #endif + Finally f([] { logger->stop(); }); + programPath = argv[0]; auto programName = std::string(baseNameOf(programPath)); @@ -279,8 +281,6 @@ void mainWrapped(int argc, char * * argv) verbosity = lvlInfo; } - Finally f([] { logger->stop(); }); - NixArgs args; if (argc == 2 && std::string(argv[1]) == "__dump-args") { |