Skip to content

Commit 759f30d

Browse files
committed
Make documentation build reproducible using sort
Order of files in a directory is not stable causing diffs in binary between two builds.
1 parent ef24bc7 commit 759f30d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/server/ruby/bin/qt-doc.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
example_html_map = {}
242242
example_dirs = ["Apprentice", "Illusionist", "Magician", "Sorcerer", "Wizard", "Algomancer"]
243243
example_dirs.each do |ex_dir|
244-
Dir["#{examples_path}/#{ex_dir.downcase}/*.rb"].each do |path|
244+
Dir["#{examples_path}/#{ex_dir.downcase}/*.rb"].sort.each do |path|
245245
bname = File.basename(path, ".rb")
246246
bname = ActiveSupport::Inflector.titleize(bname)
247247
name = "[#{ex_dir}] #{bname}"
@@ -271,7 +271,7 @@
271271
languages =
272272
Dir[File.expand_path("../lang/sonic-pi-tutorial-*.po", tutorial_path)].
273273
map { |p| File.basename(p).gsub(/sonic-pi-tutorial-(.*?).po/, '\1') }.
274-
sort_by {|n| -n.length}
274+
sort_by {|n| [-n.length, n]}
275275

276276
docs << "\n"
277277

0 commit comments

Comments
 (0)