Skip to content

Commit 5b1041a

Browse files
authored
Merge pull request #1882 from dscho/misc-fixes
A couple of minor fixes
2 parents e635a81 + 63d1382 commit 5b1041a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

script/serve-public.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ const handler = (request, response) => {
3636

3737
let stats = fs.statSync(filename, { throwIfNoEntry: false });
3838
if (!stats?.isFile() && !filename.match(/\.[A-Za-z0-9]{1,11}$/)) {
39-
filename += ".html";
40-
stats = fs.statSync(filename, { throwIfNoEntry: false });
39+
filename += ".html";
40+
stats = fs.statSync(filename, { throwIfNoEntry: false });
4141
}
4242
try{
4343
if (!stats?.isFile()) throw new Error(`Not a file: ${filename}`);

script/update-book2.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def genbook(language_code, &get_content)
196196
end
197197

198198
images.each do |path|
199-
content = get_content.call(path)
199+
content = get_content.call(path, :gently => true)
200200
csection.saveImage(path, content)
201201
rescue Errno::ENOENT
202202
begin
@@ -289,11 +289,11 @@ def remote_genbook2(language_code)
289289
# Generate book html directly from local git repo"
290290
def local_genbook2(language_code, worktree_path)
291291
if language_code && worktree_path
292-
book = genbook(language_code) do |filename|
292+
book = genbook(language_code) do |filename, options={}|
293293
File.open(File.join(worktree_path, filename), "r") { |infile| File.read(infile) }
294-
rescue
295-
puts "::error::#{filename} is missing!"
296-
"**ERROR**: _#{filename} is missing_"
294+
rescue => e
295+
puts "::error::#{filename} is missing!" unless options[:gently]
296+
raise e
297297
end
298298
book.sha = `git -C "#{worktree_path}" rev-parse HEAD`.chomp
299299
if language_code == 'en'

0 commit comments

Comments
 (0)