Skip to content

Fix broken .mobi build #1656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2021
Merged
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
8 changes: 5 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace :book do
end

desc 'build basic book formats'
task :build => [:build_html, :build_epub, :build_pdf] do
task :build => [:build_html, :build_epub, :build_mobi, :build_pdf] do
begin
# Run check
Rake::Task['book:check'].invoke
Expand All @@ -50,7 +50,7 @@ namespace :book do
end

desc 'build basic book formats (for ci)'
task :ci => [:build_html, :build_epub, :build_pdf] do
task :ci => [:build_html, :build_epub, :build_mobi, :build_pdf] do
# Run check, but don't ignore any errors
Rake::Task['book:check'].invoke
end
Expand Down Expand Up @@ -84,6 +84,8 @@ namespace :book do

desc 'build Mobi format'
task :build_mobi => 'book/contributors.txt' do
check_contrib()

puts "Converting to Mobi (kf8)..."
`bundle exec asciidoctor-epub3 #{params} -a ebook-format=kf8 progit.asc`
puts " -- Mobi output at progit.mobi"
Expand Down Expand Up @@ -111,7 +113,7 @@ namespace :book do
begin
puts 'Removing generated files'

FileList['book/contributors.txt', 'progit.html', 'progit.epub', 'progit.pdf'].each do |file|
FileList['book/contributors.txt', 'progit.html', 'progit.epub', 'progit.mobi', 'progit.pdf'].each do |file|
rm file

# Rescue if file not found
Expand Down