summaryrefslogtreecommitdiff
path: root/omnibus/config/software
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-05-05 21:27:07 -0700
committerTim Smith <tsmith84@gmail.com>2020-05-05 21:27:07 -0700
commitc9a9012a60c3c757ccd9807466e68e6e0ab014ba (patch)
tree733e0b66f72521b418c035e54197cc867a9112c6 /omnibus/config/software
parent1e37a98b36716849cbbc4a5d46fe7d7cfab74b6a (diff)
downloadchef-c9a9012a60c3c757ccd9807466e68e6e0ab014ba.tar.gz
Cleanup gemfile/gemspecs if the bin dir is empty
Now that we've cleaned up some bin files the dirs might be empty. In that case we're not going to appbundle and we can nuke these Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'omnibus/config/software')
-rw-r--r--omnibus/config/software/more-ruby-cleanup.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/omnibus/config/software/more-ruby-cleanup.rb b/omnibus/config/software/more-ruby-cleanup.rb
index 959bbfe1b5..2fbfbec14c 100644
--- a/omnibus/config/software/more-ruby-cleanup.rb
+++ b/omnibus/config/software/more-ruby-cleanup.rb
@@ -97,8 +97,11 @@ build do
}
Dir.glob(Dir.glob("#{target_dir}/*/{#{files.join(",")}}")).each do |f|
- # don't delete these files if there's a bin dir in the same dir or we're in a chef owned gem
- next if Dir.exist?(File.join(File.dirname(f), "bin")) || File.basename(File.expand_path("..", f)).start_with?("chef-")
+ # don't delete these files if there's a non-empty bin dir in the same dir
+ next if Dir.exist?(File.join(File.dirname(f), "bin")) && !Dir.empty?(File.join(File.dirname(f), "bin"))
+
+ # dont' perform this cleanup in chef gems
+ next if File.basename(File.expand_path("..", f)).start_with?("chef-")
puts "Deleting #{f}"
FileUtils.rm_rf(f)