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 Aug 14, 2024
1 parent 1195cf7 commit 7e77aef
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 @@ -291,6 +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
STDERR.puts "::error::#{filename} is missing!"
"**ERROR**: _#{filename} is missing_"
end
book.sha = `git -C "#{worktree_path}" rev-parse HEAD`.chomp
if language_code == 'en'
Expand Down

0 comments on commit 7e77aef

Please sign in to comment.