Skip to content

Commit

Permalink
rubocop corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
leefaisonr committed Jun 5, 2023
1 parent f75cc97 commit 81daf81
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions data/copy_images.rb
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# This is an example of what we want our script to look like for transferring image files from a source location to a destination.
# This is an example of what we want our script to look like for
# transferring image files from a source location to a destination.
# ruby data/copy_images.rb /Users/faisonr/Downloads/imagecat-images-practice-1/input/disk14 s3://puliiif-staging
source = ARGV[0]
destination = ARGV[1]
puts "Copying files from #{source} to #{destination}"
files = Dir["#{source}/**/*.tiff"]
files.each do |file_name|
puts file_name
file_parts = file_name.split("/")
file_parts[-1] = file_parts[-1].chop
s3_safe_file_name = "imagecat-#{file_parts[-4..-1].join("-")}"
file_parts = file_name.split('/')
file_parts[-1] = file_parts[-1].chop
s3_safe_file_name = "imagecat-#{file_parts[-4..].join('-')}"
`aws s3 cp #{file_name} #{destination}/#{s3_safe_file_name}`
end

# "/Users/faisonr/Downloads/imagecat-images-practice-1/input/disk14/**/*.tiff"
# "/Users/faisonr/Downloads/imagecat-images-practice-1/input/disk14/**/*.tiff"

0 comments on commit 81daf81

Please sign in to comment.