forked from lix-project/lix
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.
This commit is contained in:
parent
7062ebf5be
commit
1461e6cdda
|
@ -543,8 +543,6 @@ static void main_nix_build(int argc, char * * argv)
|
|||
|
||||
restoreProcessContext();
|
||||
|
||||
logger->stop();
|
||||
|
||||
execvp(shell->c_str(), argPtrs.data());
|
||||
|
||||
throw SysError("executing shell '%s'", *shell);
|
||||
|
@ -603,8 +601,6 @@ static void main_nix_build(int argc, char * * argv)
|
|||
outPaths.push_back(outputPath);
|
||||
}
|
||||
|
||||
logger->stop();
|
||||
|
||||
for (auto & path : outPaths)
|
||||
std::cout << store->printStorePath(path) << '\n';
|
||||
}
|
||||
|
|
|
@ -1489,8 +1489,6 @@ static int main_nix_env(int argc, char * * argv)
|
|||
|
||||
globals.state->printStats();
|
||||
|
||||
logger->stop();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1095,8 +1095,6 @@ static int main_nix_store(int argc, char * * argv)
|
|||
|
||||
op(opFlags, opArgs);
|
||||
|
||||
logger->stop();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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") {
|
||||
|
|
Loading…
Reference in a new issue