]> git.openstreetmap.org Git - rails.git/commitdiff
Restrict files read from directory
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 10 Aug 2022 12:48:27 +0000 (13:48 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 10 Aug 2022 12:48:27 +0000 (13:48 +0100)
lib/osm_community_index.rb

index 1e868580da3da03c9dc70a4c407f666657155f90..baee381d0f75a1ddbd40a1ec1e189e502cb62c31 100644 (file)
@@ -1,7 +1,7 @@
 module OsmCommunityIndex
   def self.add_to_i18n
     communities = Community.all
-    files = Dir.glob(Rails.root.join("node_modules/osm-community-index/i18n/*"))
+    files = Dir.glob(Rails.root.join("node_modules/osm-community-index/i18n/*.yaml"))
     files.each do |file|
       locale = File.basename(file, ".yaml")
       community_locale_yaml = YAML.safe_load(File.read(file))[locale]