Skip to content

Commit

Permalink
!fixup use <homedir>/.node_repl_history as default
Browse files Browse the repository at this point in the history
  • Loading branch information
Fishrock123 committed Jul 22, 2015
1 parent d78f505 commit 8664f5e
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/internal/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,9 @@ function createRepl(env, cb) {
}

function setupHistory(repl, historyPath, ready) {
// default to using <homedir>/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 <homedir>/.node_history_file
if (!historyPath) {
historyPath = path.join(os.homedir(), '.node_repl_history');
}

var timer = null;
Expand Down

0 comments on commit 8664f5e

Please sign in to comment.