From 13fa69341255914439025ab9214d526474a03de6 Mon Sep 17 00:00:00 2001 From: Daniele Palombo <387690+DanielePalombo@users.noreply.github.com> Date: Mon, 17 Apr 2023 19:26:46 +0200 Subject: [PATCH] Add subdirectories support --- lib/tasks/deprecations/combine.rake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tasks/deprecations/combine.rake b/lib/tasks/deprecations/combine.rake index 2f9b3b3..811476f 100644 --- a/lib/tasks/deprecations/combine.rake +++ b/lib/tasks/deprecations/combine.rake @@ -7,9 +7,10 @@ namespace :deprecations do task :combine, [:matrix_folder, :matrix_filename] do |_t, args| matrix_folder = args[:matrix_folder].to_s - combined_matrix = Dir.entries(matrix_folder).select { |f| !f.start_with?('.') }.inject({}) do |temp_matrix, file_name| + yaml_files = Dir.glob("#{matrix_folder}/**/*.yml").reject { |f| File.directory?(f) } + combined_matrix = yaml_files.inject({}) do |temp_matrix, file_name| begin - matrix = YAML.load_file("#{matrix_folder}/#{file_name}") + matrix = YAML.load_file(file_name) temp_matrix.merge(matrix) do |file, oldval, newval| oldval.merge(newval) do |line, old_deprecation, new_deprecation|