Skip to content

Commit

Permalink
update-book2: avoid bogus warnings about missing images
Browse files Browse the repository at this point in the history
When an image is not found in the new-style location (i.e. in the
`images/` folder at the top level of the worktree), we want to fall back
to the old-style location _and not warn anybody about it_!

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Sep 26, 2024
1 parent 7e97918 commit f06704c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions script/update-book2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def genbook(language_code, &get_content)
end

images.each do |path|
content = get_content.call(path)
content = get_content.call(path, :gently => true)
csection.saveImage(path, content)
rescue Errno::ENOENT
begin
Expand Down Expand Up @@ -289,10 +289,10 @@ def remote_genbook2(language_code)
# Generate book html directly from local git repo"
def local_genbook2(language_code, worktree_path)
if language_code && worktree_path
book = genbook(language_code) do |filename|
book = genbook(language_code) do |filename, options={}|
File.open(File.join(worktree_path, filename), "r") { |infile| File.read(infile) }
rescue => e
puts "::error::#{filename} is missing!"
puts "::error::#{filename} is missing!" unless options[:gently]
raise e
end
book.sha = `git -C "#{worktree_path}" rev-parse HEAD`.chomp
Expand Down

0 comments on commit f06704c

Please sign in to comment.