diff options
author | EuAndreh <eu@euandre.org> | 2020-12-28 09:18:52 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-12-28 09:18:52 -0300 |
commit | de5ce4e3ea135a26470b29882d6792ce18321dbf (patch) | |
tree | bbb4b03772c7e63cc8a74a422759b25d14e1825a /_plugins/linter.rb | |
parent | Add resources/screencasts/2020-12-24-sample-screencast.mkv sample video file (diff) | |
download | euandre.org-de5ce4e3ea135a26470b29882d6792ce18321dbf.tar.gz euandre.org-de5ce4e3ea135a26470b29882d6792ce18321dbf.tar.xz |
linter.rb: Don't fail first build to avoid chicken and egg problem
Diffstat (limited to '_plugins/linter.rb')
-rw-r--r-- | _plugins/linter.rb | 15 |
1 files changed, 11 insertions, 4 deletions
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 |