diff --git a/bin/repl b/bin/repl old mode 100644 new mode 100755 index 7daaebf..5900665 --- a/bin/repl +++ b/bin/repl @@ -42,16 +42,16 @@ if ARGV.include? '--man' end completion_dir = ENV['REPL_COMPLETION_DIR'] || "~/.repl" -if File.exists?(cdir = File.expand_path(completion_dir)) +if File.exist?(cdir = File.expand_path(completion_dir)) script = ARGV.detect { |a| a !~ /^-/ } if script cfile = Dir[cdir + '/' + File.basename(script)].first - cfile = nil if cfile && !File.exists?(cfile) + cfile = nil if cfile && !File.exist?(cfile) end end history_dir = ENV['REPL_HISTORY_DIR'] || "~/" -if File.exists?(hdir = File.expand_path(history_dir)) +if File.exist?(hdir = File.expand_path(history_dir)) if script = ARGV.detect { |a| a !~ /^-/ } script = File.basename(script) hfile = "#{hdir}/.#{script}_history"