save persisted state into $XDG_DATA_HOME/rpl.rb/env.rpl

This commit is contained in:
Gwenhael Le Moine 2022-10-30 15:22:23 +01:00
parent 561ec1072a
commit 41a0d5e7e4
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

10
bin/rpl
View file

@ -77,8 +77,16 @@ class RplRepl
end
end
def persistence_filename
persistence_dir = ENV['XDG_DATA_HOME']
persistence_dir ||= '~/.local/share'
persistence_dir += '/rpl.rb'
File.expand_path( "#{persistence_dir}/env.rpl" )
end
options = { run_REPL: ARGV.empty?,
persistence_filename: File.expand_path( '~/.local/state/rpl.rb/machine' ),
persistence_filename: persistence_filename,
live_persistence: true,
files: [],
programs: [] }