From 41a0d5e7e4d494977db264f45b64765e72039201 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Sun, 30 Oct 2022 15:22:23 +0100 Subject: [PATCH] save persisted state into $XDG_DATA_HOME/rpl.rb/env.rpl --- bin/rpl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/rpl b/bin/rpl index b6a3027..cd39348 100755 --- a/bin/rpl +++ b/bin/rpl @@ -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: [] }