forked from lix-project/lix
refactor: factor out getValue
This commit is contained in:
parent
9f8c1183fa
commit
7534798eed
|
@ -920,8 +920,7 @@ struct CmdRepl : InstallablesCommand
|
||||||
void run(ref<Store> store) override
|
void run(ref<Store> store) override
|
||||||
{
|
{
|
||||||
auto state = getEvalState();
|
auto state = getEvalState();
|
||||||
auto repl = std::make_unique<NixRepl>(searchPath, openStore(),state
|
auto getValues = [&]()->NixRepl::AnnotatedValues{
|
||||||
,[&]()->NixRepl::AnnotatedValues{
|
|
||||||
auto installables = load();
|
auto installables = load();
|
||||||
NixRepl::AnnotatedValues values;
|
NixRepl::AnnotatedValues values;
|
||||||
for (auto & installable: installables){
|
for (auto & installable: installables){
|
||||||
|
@ -930,7 +929,12 @@ struct CmdRepl : InstallablesCommand
|
||||||
values.push_back( {val,what} );
|
values.push_back( {val,what} );
|
||||||
}
|
}
|
||||||
return values;
|
return values;
|
||||||
}
|
};
|
||||||
|
auto repl = std::make_unique<NixRepl>(
|
||||||
|
searchPath,
|
||||||
|
openStore(),
|
||||||
|
state,
|
||||||
|
getValues
|
||||||
);
|
);
|
||||||
repl->autoArgs = getAutoArgs(*repl->state);
|
repl->autoArgs = getAutoArgs(*repl->state);
|
||||||
repl->mainLoop();
|
repl->mainLoop();
|
||||||
|
|
Loading…
Reference in a new issue