1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Skip the initialization of XDG_DATA_HOME with Permission denied

This commit is contained in:
Hiroshi SHIBATA 2020-04-23 21:11:21 +09:00
parent 5c6269c459
commit 03e4eeabbf
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2

View file

@ -129,12 +129,15 @@ module RDoc
if File.directory?(rdoc_dir)
rdoc_dir
else
begin
# XDG
xdg_data_home = ENV["XDG_DATA_HOME"] || File.join(File.expand_path("~"), '.local', 'share')
unless File.exist?(xdg_data_home)
FileUtils.mkdir_p xdg_data_home
end
File.join xdg_data_home, "rdoc"
rescue Errno::EACCES
end
end
end