From 8664f5e56991ed7b9ad6762a49450ac5346dc075 Mon Sep 17 00:00:00 2001 From: Jeremiah Senkpiel Date: Wed, 22 Jul 2015 10:35:10 -0700 Subject: [PATCH] !fixup use /.node_repl_history as default --- lib/internal/repl.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/internal/repl.js b/lib/internal/repl.js index 34707278088258..3b8da797dc8fcc 100644 --- a/lib/internal/repl.js +++ b/lib/internal/repl.js @@ -61,15 +61,9 @@ function createRepl(env, cb) { } function setupHistory(repl, historyPath, ready) { - // default to using /tmp/node_history_file - if (typeof historyPath !== 'string') { - const tmpdir = path.join(os.homedir(), 'tmp') - try { - fs.mkdirSync(tmpdir); - } catch (err) { - if (err.code !== 'EEXIST') throw err; - } - historyPath = path.join(tmpdir, 'node_repl_history'); + // default to using /.node_history_file + if (!historyPath) { + historyPath = path.join(os.homedir(), '.node_repl_history'); } var timer = null;