aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorregnat <rg@regnat.ovh>2021-02-05 13:35:31 +0100
committerregnat <rg@regnat.ovh>2021-03-02 14:59:12 +0100
commit7331da99abead2b59efcfdaf729cb1034642b630 (patch)
treed583f7e96125d971762b619853c6d93447ca7ba9 /src
parente64cf8e0a330590ef200359b91f98332e46791c7 (diff)
Make NIX_SHOW_STATS work with new-style commands
Diffstat (limited to 'src')
-rw-r--r--src/libcmd/command.hh2
-rw-r--r--src/libcmd/installables.cc6
2 files changed, 8 insertions, 0 deletions
diff --git a/src/libcmd/command.hh b/src/libcmd/command.hh
index c02193924..e66c697eb 100644
--- a/src/libcmd/command.hh
+++ b/src/libcmd/command.hh
@@ -48,6 +48,8 @@ struct EvalCommand : virtual StoreCommand, MixEvalArgs
ref<EvalState> getEvalState();
std::shared_ptr<EvalState> evalState;
+
+ ~EvalCommand();
};
struct MixFlakeOptions : virtual Args, EvalCommand
diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc
index 4739dc974..7102f5a1a 100644
--- a/src/libcmd/installables.cc
+++ b/src/libcmd/installables.cc
@@ -280,6 +280,12 @@ ref<EvalState> EvalCommand::getEvalState()
return ref<EvalState>(evalState);
}
+EvalCommand::~EvalCommand()
+{
+ if (evalState)
+ evalState->printStats();
+}
+
void completeFlakeRef(ref<Store> store, std::string_view prefix)
{
if (prefix == "")