class KPM::BaseArtifact
def remove_old_default_bundles(coordinate_map, artifact_info, downloaded_artifact_info)
def remove_old_default_bundles(coordinate_map, artifact_info, downloaded_artifact_info) return unless coordinate_map[:artifact_id] == 'killbill-platform-osgi-bundles-defaultbundles' downloaded_default_bundles = Utils.peek_tgz_file_names(downloaded_artifact_info[:file_path]) existing_default_bundles = Dir.glob("#{artifact_info[:dir_name]}/*") existing_default_bundles.each do |bundle| bundle_name = Utils.get_plugin_name_from_file_path(bundle) is_downloaded = downloaded_default_bundles.index {|file_name| file_name.include? bundle_name} unless is_downloaded.nil? FileUtils.remove(bundle) end end end