diff options
-rw-r--r-- | chef-config/lib/chef-config/workstation_config_loader.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/chef-config/lib/chef-config/workstation_config_loader.rb b/chef-config/lib/chef-config/workstation_config_loader.rb index aabfe7235b..63731b729d 100644 --- a/chef-config/lib/chef-config/workstation_config_loader.rb +++ b/chef-config/lib/chef-config/workstation_config_loader.rb @@ -135,13 +135,10 @@ module ChefConfig def conf_d_files @conf_d_files ||= begin - entries = if Config[:conf_d_dir] - Dir.glob(File.join(PathHelper.escape_glob( - Config[:conf_d_dir]), "*.rb")) - else - [] - end - entries.select do |entry| + entries = Array.new + entries << Dir.glob(File.join(PathHelper.escape_glob( + Config[:conf_d_dir]), "*.rb")) if Config[:conf_d_dir] + entries.flatten.select do |entry| File.file?(entry) end end |