Skip to content

Commit

Permalink
Fix bug determining version in ext_pdf_doc backend
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Hower <[email protected]>
  • Loading branch information
dhower-qc committed Sep 18, 2024
1 parent afff046 commit 25a53b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backends/ext_pdf_doc/tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ rule %r{#{$root}/gen/ext_pdf_doc/.*/adoc/.*_extension\.adoc} => proc { |tname|
erb.filename = template_path.to_s

ext = arch_def.extension(ext_name)
version_num = ENV.key?("EXT_VERSION") ? ENV["EXT_VERSION"] : ext.versions.sort { |v| Gem::Version.new(v["version"]) }.last["version"]
version_num =
if ENV.key?("EXT_VERSION")
ENV["EXT_VERSION"]
else
ext.versions.max { |a, b| Gem::Version.new(a["version"]) <=> Gem::Version.new(b["version"]) }["version"]
end
ext_version = ext.versions.find { |v| v["version"] == version_num }
FileUtils.mkdir_p File.dirname(t.name)
File.write t.name, AsciidocUtils.resolve_links(arch_def.find_replace_links(erb.result(binding)))
Expand Down

0 comments on commit 25a53b2

Please sign in to comment.