From 5be8334b5d03ed74a75ef7c2b741a319f62a6c49 Mon Sep 17 00:00:00 2001 From: Kenshi Muto Date: Sat, 13 Jun 2020 14:35:58 +0900 Subject: [PATCH] skip temporary built directories in copying at test stage. --- test/test_helper.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index 70f06a712..881dc7021 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -14,7 +14,10 @@ def assets_dir def prepare_samplebook(srcdir, bookdir, latextemplatedir, configfile) samplebook_dir = File.expand_path("../samples/#{bookdir}/", File.dirname(__FILE__)) - FileUtils.cp_r(Dir.glob(File.join(samplebook_dir, '*')), srcdir) + files = Dir.glob(File.join(samplebook_dir, '*')) + # ignore temporary built files + files.delete_if { |file| file =~ /.*\-(pdf|epub|text)/ || file == 'webroot' } + FileUtils.cp_r(files, srcdir) if latextemplatedir # copy from review-jsbook or review-jlreq template_dir = File.expand_path("../templates/latex/#{latextemplatedir}/", File.dirname(__FILE__))