From de5ce4e3ea135a26470b29882d6792ce18321dbf Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 28 Dec 2020 09:18:52 -0300 Subject: linter.rb: Don't fail first build to avoid chicken and egg problem --- _plugins/linter.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to '_plugins') diff --git a/_plugins/linter.rb b/_plugins/linter.rb index aa55c8c..4db2b5f 100644 --- a/_plugins/linter.rb +++ b/_plugins/linter.rb @@ -120,17 +120,24 @@ module Jekyll end end + @@first_build = true def assert_git_annex(site) url = site.config['url'] stdout = `git annex find --not --in web` if stdout != '' or not $?.success? then puts 'Files in Git Annex not published to "web" remote:' puts stdout - puts 'Add them with:' - stdout.strip.split('\n').each do |file| - puts " git annex addurl --file #{file} #{url}/#{file}" + puts "Add them with:\n\n" + stdout.strip.split("\n").each do |file| + puts "git annex addurl --file #{file} #{url}/#{file}" + end + msg = "\nBuild again after files above are added" + if @@first_build then + @@first_build = false + puts msg + else + raise msg end - raise 'Build again after files above are added' end end -- cgit v1.2.3