Skip to content

Commit

Permalink
Make XDG_DATA_DIRS obey the basedir spec
Browse files Browse the repository at this point in the history
  • Loading branch information
cmrd-senya committed Aug 30, 2020
1 parent 36b4708 commit 0f7f915
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/xdg/base_dir.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ class BaseDir
require 'rbconfig'

sysconfdir = ::RbConfig::CONFIG['sysconfdir'] || '/etc'
datadir = ::RbConfig::CONFIG['datadir'] || '/usr/share'

# Standard defaults for locations.
DEFAULTS = {
'XDG_DATA_HOME' => ['~/.local/share'],
'XDG_DATA_DIRS' => ['/usr/local/share', datadir],
'XDG_DATA_DIRS' => ['/usr/local/share', '/usr/share'],
'XDG_CONFIG_HOME' => ['~/.config'],
'XDG_CONFIG_DIRS' => [File.join(sysconfdir,'xdg'), sysconfdir],
'XDG_CACHE_HOME' => ['~/.cache'],
Expand Down

0 comments on commit 0f7f915

Please sign in to comment.