Skip to content

Commit

Permalink
update-book2: do allow the fallback for old image locations to work
Browse files Browse the repository at this point in the history
Recent revisions of the ProGit book have their images in the `images/`
directory located at the top-level, but older revisions had them next to
the chapters that referenced those images.

The `update-book2.rb` script has a fall-back to allow those images to be
copied from the old-style locations.

This fall-back relies on an exception to be raised when an image does
not show up in the new-style location, but we returned a warning
instead. Let's not. Let's raise that exception again.

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Sep 26, 2024
1 parent e652366 commit 7e97918
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script/update-book2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ def local_genbook2(language_code, worktree_path)
if language_code && worktree_path
book = genbook(language_code) do |filename|
File.open(File.join(worktree_path, filename), "r") { |infile| File.read(infile) }
rescue
rescue => e
puts "::error::#{filename} is missing!"
"**ERROR**: _#{filename} is missing_"
raise e
end
book.sha = `git -C "#{worktree_path}" rev-parse HEAD`.chomp
if language_code == 'en'
Expand Down

0 comments on commit 7e97918

Please sign in to comment.