diff options
author | Nobuyoshi Nakada <[email protected]> | 2022-03-31 12:51:04 +0900 |
---|---|---|
committer | git <[email protected]> | 2022-10-28 09:36:28 +0000 |
commit | 4021c6565f9655bfd667152f76f22f7cc81c7e17 (patch) | |
tree | e4369f2c672e6c22b21dd4f784cb056ecc5789b5 /lib | |
parent | 56c97a6621241db99f7c96740164bdd8f898d881 (diff) |
[ruby/irb] Do not make non-existent XDG directory on start
(https://github.com/ruby/irb/pull/357)
https://github.com/ruby/irb/commit/298b134792
Diffstat (limited to 'lib')
-rw-r--r-- | lib/irb/init.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/irb/init.rb b/lib/irb/init.rb index 11d10c5bab..5409528fae 100644 --- a/lib/irb/init.rb +++ b/lib/irb/init.rb @@ -379,11 +379,9 @@ module IRB # :nodoc: end if xdg_config_home = ENV["XDG_CONFIG_HOME"] irb_home = File.join(xdg_config_home, "irb") - unless File.exist? irb_home - require 'fileutils' - FileUtils.mkdir_p irb_home + if File.directory?(irb_home) + yield proc{|rc| irb_home + "/irb#{rc}"} end - yield proc{|rc| irb_home + "/irb#{rc}"} end if home = ENV["HOME"] yield proc{|rc| home+"/.irb#{rc}"} |