I've got a book that I'm developing on Github using Travis CI so that it rebuilds the book after every commit. I'm going to be doing this with a lot of books. I'd like to include .mobi files in the output of the build. I've got it working, except for one thing.
Right now I have to manually specify the ePub filename and location in the _build.sh file using the following command:
Rscript -e "bookdown::calibre('_book/filename.epub', 'mobi')"
This is in contrast to the command to create the epub, which is generic enough to work on any book I would create, since it starts from the main index.Rmd file:
Rscript -e "bookdown::render_book('index.Rmd', 'bookdown::epub_book')"
Is there any way for me to get the name of the epub file programmatically and insert it into the R command so that I don't have to manually look it up and change this command for every book?