Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/trepl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis BRENON <brenon.alexis@gmail.com>2017-06-19 14:47:30 +0300
committerSoumith Chintala <soumith@gmail.com>2017-06-19 14:47:30 +0300
commite5e17e3a56997123bd6c66cb8575175d3a6945bb (patch)
treefea5d5d7bb481616b49505acbea38c55377bbb06
parent818868e23521ec1eb6b4bea32714fe39024e01db (diff)
Allow to use different history file (#64)HEADmaster
Look for the TREPL_HISTORY environment variable to use it as a path to the history file.
-rw-r--r--init.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index c46f675..73bd34f 100644
--- a/init.lua
+++ b/init.lua
@@ -544,9 +544,9 @@ _LAST = ''
-- Readline:
local readline_ok,readline = pcall(require,'readline')
local nextline,saveline
-if readline_ok and (os.getenv('HOME') or os.getenv('USERPROFILE')) ~= nil then
+if readline_ok and (os.getenv('TREPL_HISTORY') or os.getenv('HOME') or os.getenv('USERPROFILE')) ~= nil then
-- Readline found:
- local history = (os.getenv('HOME') or os.getenv('USERPROFILE')) .. '/.luahistory'
+ local history = os.getenv('TREPL_HISTORY') or ((os.getenv('HOME') or os.getenv('USERPROFILE')) .. '/.luahistory')
readline.setup()
readline.read_history(history)
nextline = function(aux)