Skip to content

Commit

Permalink
Merge pull request #1882 from dscho/misc-fixes
Browse files Browse the repository at this point in the history
A couple of minor fixes
  • Loading branch information
ttaylorr authored Sep 26, 2024
2 parents e635a81 + 63d1382 commit 5b1041a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions script/serve-public.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const handler = (request, response) => {

let stats = fs.statSync(filename, { throwIfNoEntry: false });
if (!stats?.isFile() && !filename.match(/\.[A-Za-z0-9]{1,11}$/)) {
filename += ".html";
stats = fs.statSync(filename, { throwIfNoEntry: false });
filename += ".html";
stats = fs.statSync(filename, { throwIfNoEntry: false });
}
try{
if (!stats?.isFile()) throw new Error(`Not a file: ${filename}`);
Expand Down
10 changes: 5 additions & 5 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,11 +289,11 @@ 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
puts "::error::#{filename} is missing!"
"**ERROR**: _#{filename} is missing_"
rescue => e
puts "::error::#{filename} is missing!" unless options[:gently]
raise e
end
book.sha = `git -C "#{worktree_path}" rev-parse HEAD`.chomp
if language_code == 'en'
Expand Down

0 comments on commit 5b1041a

Please sign in to comment.