diff --git a/src/cb/psql.cr b/src/cb/psql.cr index 5db36fc..0d39917 100644 --- a/src/cb/psql.cr +++ b/src/cb/psql.cr @@ -94,8 +94,9 @@ module CB s << "%[%033[36m%]#{c.name}%[%033m%]" end + user_psqlrc = File.expand_path("~/.psqlrc", home: true) psqlrc = File.tempfile(c.id, "psqlrc") - File.copy("~/.psqlrc", psqlrc.path) if File.exists?("~/.psqlrc") + File.copy(user_psqlrc, psqlrc.path) if File.exists?(user_psqlrc) File.open(psqlrc.path, "a") do |f| f.puts "\\set ON_ERROR_ROLLBACK interactive" f.puts "\\set PROMPT1 '#{psqlpromptname}/%[%033[33;1m%]%x%x%x%[%033[0m%]%[%033[1m%]%/%[%033[0m%]%R%# '"