Permalink
Browse files

Make dump write a bibtex bibliography of all entries.

  • Loading branch information...
1 parent 3187c3c commit 4cf20a5da6f4fffb17a4b7332d9ebfe907c6462b @jgm committed Mar 18, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 bin/cloudlib
View
@@ -228,12 +228,18 @@ if ARGV.length >= 1
file.write(html_version(entries))
end
STDERR.puts "Backing up files:"
+ bibtex = []
entries.each do |entry|
if not File.exists?("#{path}/#{entry.name}")
entry.download("#{path}/#{entry.name}")
new_entries += 1
STDERR.puts entry.to_s
end
+ bibtex << entry.to_bibtex
+ end
+ open("#{path}/references.bib", 'w') do |file|
+ STDERR.puts "Writing bibtex bibliography..."
+ file.write(bibtex.join("\n\n"))
end
STDERR.puts "Backed up metadata and #{new_entries} new files."
exit 0

0 comments on commit 4cf20a5

Please sign in to comment.