nix repl: warn if creating dir for history fails

The history is not critical to the functionality of nix repl, so it's
enough to warn here, rather than refuse to start if the directory Nix
thinks the history should live in can't be created.
This commit is contained in:
Alyssa Ross 2022-09-20 11:01:40 +00:00
parent 9d860f3467
commit d234d01f01
No known key found for this signature in database
GPG key ID: F9DBED4859B271C0

View file

@ -242,7 +242,11 @@ void NixRepl::mainLoop()
// Allow nix-repl specific settings in .inputrc
rl_readline_name = "nix-repl";
createDirs(dirOf(historyFile));
try {
createDirs(dirOf(historyFile));
} catch (SysError & e) {
logWarning(e.info());
}
#ifndef READLINE
el_hist_size = 1000;
#endif