mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 16:26:18 +02:00
repl: provide backward compat with legacy usage
This commit is contained in:
parent
7534798eed
commit
e1f308a1ec
2 changed files with 17 additions and 1 deletions
|
@ -120,7 +120,7 @@ struct InstallablesCommand : virtual Args, SourceExprCommand
|
||||||
|
|
||||||
std::optional<FlakeRef> getFlakeRefForCompletion() override;
|
std::optional<FlakeRef> getFlakeRefForCompletion() override;
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
|
|
||||||
std::vector<std::string> _installables;
|
std::vector<std::string> _installables;
|
||||||
};
|
};
|
||||||
|
|
|
@ -895,6 +895,22 @@ struct CmdRepl : InstallablesCommand
|
||||||
CmdRepl(){
|
CmdRepl(){
|
||||||
evalSettings.pureEval = false;
|
evalSettings.pureEval = false;
|
||||||
}
|
}
|
||||||
|
void prepare()
|
||||||
|
{
|
||||||
|
if (!settings.isExperimentalFeatureEnabled(Xp::Flakes) && !(file)) {
|
||||||
|
warn("future versions of Nix will require using `--file` to load a file");
|
||||||
|
if (this->_installables.size() > 1) {
|
||||||
|
warn("more than one input file is not currently supported");
|
||||||
|
}
|
||||||
|
if (this->_installables.size() >= 1) {
|
||||||
|
file = std::optional(
|
||||||
|
this->_installables[0].data()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
_installables.clear();
|
||||||
|
}
|
||||||
|
installables = InstallablesCommand::load();
|
||||||
|
}
|
||||||
std::vector<std::string> files;
|
std::vector<std::string> files;
|
||||||
Strings getDefaultFlakeAttrPaths() override
|
Strings getDefaultFlakeAttrPaths() override
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue