Skip to content

Commit

Permalink
update-book2.rb: gracefully warn about missing files, but continue
Browse files Browse the repository at this point in the history
When a file goes missing but is still referenced, as was the case with
progit/progit2-zh#507, we do not want the entire
book rendering business on https://git-scm.com/ to halt before that bug
is fixed.

Let's instead warn about this and continue to render the book.

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Sep 11, 2024
1 parent 15e61bd commit 59fbc05
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions script/update-book2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,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
puts "::error::#{filename} is missing!"
"**ERROR**: _#{filename} is missing_"
end
if language_code == 'en'
latest_tag = `git -C "#{worktree_path}" for-each-ref --format '%(refname:short)' --sort=-committerdate --count=1 refs/tags/`.chomp
Expand Down

0 comments on commit 59fbc05

Please sign in to comment.