Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions script/serve-public.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,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
Loading