Skip to content

Commit

Permalink
Do not load user config if HOME is unset.
Browse files Browse the repository at this point in the history
  • Loading branch information
nning committed Aug 5, 2015
1 parent 812ce36 commit 5c41c00
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bin/transmission-rss
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,13 @@ rescue Errno::ENOENT
log.error(config_file + ' not found')
end

# Check for user configuration and load if existing.
unless custom_config
prefix = ENV['XDG_CONFIG_HOME'] || File.join(ENV['HOME'], '.config')
# Unless a custom config is given as an argument from command line or HOME is
# unset, check for user configuration and load if existing.
if !(custom_config || ENV['HOME'].nil?)
prefix = ENV['XDG_CONFIG_HOME'] || File.expand_path('~/.config')
path = File.join(prefix, 'transmission-rss', 'config.yml')

if File.exists? path
if File.exists?(path)
log.debug('loading user config ' + path)
config.load(path)
end
Expand Down

0 comments on commit 5c41c00

Please sign in to comment.