Skip to content

Commit

Permalink
Make finding the home_dir a little more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
bf4 committed Jul 13, 2014
1 parent bbe6832 commit 34696d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/simplecov/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@
end

# Autoload config from ~/.simplecov if present
if ENV['HOME']
global_config_path = File.join(File.expand_path("~"), '.simplecov')
require 'etc'
home_dir = Dir.home || Etc.getpwuid.dir || (user = ENV["USER"] && Dir.home(user))
if home_dir
global_config_path = File.join(home_dir, '.simplecov')
load global_config_path if File.exist?(global_config_path)
end

Expand Down

0 comments on commit 34696d4

Please sign in to comment.