aboutsummaryrefslogtreecommitdiff
path: root/_plugins/linter.rb
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-12-28 09:18:52 -0300
committerEuAndreh <eu@euandre.org>2020-12-28 09:18:52 -0300
commitde5ce4e3ea135a26470b29882d6792ce18321dbf (patch)
treebbb4b03772c7e63cc8a74a422759b25d14e1825a /_plugins/linter.rb
parentAdd resources/screencasts/2020-12-24-sample-screencast.mkv sample video file (diff)
downloadeuandre.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.rb15
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