Skip to content

Commit

Permalink
DOI task to delete dois by prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhallett committed Feb 5, 2020
1 parent a664a6e commit 42f62a8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/tasks/doi.rake
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,17 @@ namespace :doi do
task :migrate_landing_page => :environment do
Doi.migrate_landing_page
end

desc 'Delete dois by a prefix'
task :delete_by_prefix => :environment do
if ENV['PREFIX'].nil?
puts "ENV['PREFIX'] is required."
exit
end

puts "Note: This does not delete any associated prefix."

count = Doi.delete_dois_by_prefix(ENV['PREFIX'])
puts "#{count} DOIs with prefix #{ENV['PREFIX']} deleted."
end
end

0 comments on commit 42f62a8

Please sign in to comment.