aboutsummaryrefslogtreecommitdiff
path: root/_plugins/linter.rb
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-12-27 22:04:10 -0300
committerEuAndreh <eu@euandre.org>2020-12-27 22:04:10 -0300
commit56da1a73ac0c211fbb14447b9175660d6757e795 (patch)
tree64304b4fbe3f3fb3a6fedb68c338c5ae5b1c86e4 /_plugins/linter.rb
parentTODOs.org: Add 7535169e-715e-409b-88c3-78c4bb482d95 (diff)
downloadeuandre.org-56da1a73ac0c211fbb14447b9175660d6757e795.tar.gz
euandre.org-56da1a73ac0c211fbb14447b9175660d6757e795.tar.xz
linter.rb: Add assert_git_annex
Diffstat (limited to '')
-rw-r--r--_plugins/linter.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/_plugins/linter.rb b/_plugins/linter.rb
index 5281985..188aede 100644
--- a/_plugins/linter.rb
+++ b/_plugins/linter.rb
@@ -144,9 +144,24 @@ module Jekyll
end
end
+ 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}"
+ end
+ raise 'Build again after files above are added'
+ end
+ end
+
def generate(site)
assert_unique_ids(site)
assert_frontmatter(site)
+ assert_git_annex(site)
end
end
end