Skip to content

Commit

Permalink
add namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
lsat12357 committed Nov 20, 2020
1 parent b144a57 commit 54f4e08
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions lib/tasks/migration/create_profiles.rake
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
# Requires a list of pids, one pid per line
# to call: bundle exec rake create_profiles pids=/data1/batch/profiles/pidlist.txt export_path=/data1/batch/profiles

desc 'Create asset profile yml file'
task create_profiles: :environment do
require 'hyrax/migrator/metadata_profiler'
include Hyrax::Migrator::MetadataProfiler
desc 'Create asset profile yml file'
namespace :migration do
task create_profiles: :environment do
require 'hyrax/migrator/metadata_profiler'
include Hyrax::Migrator::MetadataProfiler

export_path = ENV['export_path']
pidlist.each do |pid|
begin
item = GenericAsset.find(pid)
create_profile(export_path, item)
rescue StandardError => e
puts e.message
export_path = ENV['export_path']
pidlist.each do |pid|
begin
item = GenericAsset.find(pid)
create_profile(export_path, item)
rescue StandardError => e
puts e.message
end
end
end
end
Expand Down

0 comments on commit 54f4e08

Please sign in to comment.