mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 05:25:16 -05:00
FIX: Sort filelists to ensure consistant asset precompilation hash (#13393)
Dir.glob does not guarantee file order and can change when ran on different machines. This means that running asset precompilation on the exact same codebase will output different content hashes.
This commit is contained in:
@@ -38,7 +38,7 @@ module I18n
|
||||
end
|
||||
|
||||
def self.sort_locale_files(files)
|
||||
files.sort_by do |filename|
|
||||
files.sort.sort_by do |filename|
|
||||
matches = /(?:client|server)-([1-9]|[1-9][0-9]|100)\..+\.yml/.match(filename)
|
||||
matches&.[](1)&.to_i || 0
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user