aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/repl.cc
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-09-20 11:01:40 +0000
committerAlyssa Ross <hi@alyssa.is>2022-09-20 11:01:40 +0000
commitd234d01f010e99c1519b849dd50a502a8af7ede1 (patch)
treee6eae74ad013b117c3b7d264a0644844d7a49b5b /src/libcmd/repl.cc
parent9d860f34673fbf07a2cf07ff854ae6683dae2fb8 (diff)
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.
Diffstat (limited to 'src/libcmd/repl.cc')
-rw-r--r--src/libcmd/repl.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc
index 150bd42ac..61c05050f 100644
--- a/src/libcmd/repl.cc
+++ b/src/libcmd/repl.cc
@@ -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