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:
parent
5c6269c459
commit
03e4eeabbf
1 changed files with 8 additions and 5 deletions
13
lib/rdoc.rb
13
lib/rdoc.rb
|
@ -129,12 +129,15 @@ module RDoc
|
|||
if File.directory?(rdoc_dir)
|
||||
rdoc_dir
|
||||
else
|
||||
# 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
|
||||
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
|
||||
File.join xdg_data_home, "rdoc"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue