Skip to content
Snippets Groups Projects

Gather hidden files and fix rake task

Merged Anusha Ranganathan requested to merge bug_fix/454_gather_hidden_files into develop
2 files
+ 21
14
Compare changes
  • Side-by-side
  • Inline
Files
2
require 'json'
require 'csv'
require 'find'
class VerifyCRCDatasetImport
extend ComplexHelper
@@ -66,11 +67,11 @@ class VerifyCRCDatasetImport
msg = "Error: Import entry #{entry_id} not found"
return false, msg, paths_compared, nil
end
paths_compared[source_identifier: entry.identifier]
paths_compared[:source_identifier] = entry.identifier
# Check import id
if import_id != entry.importerexporter_id
msg = "Error: Importer id #{import_id} does not match id associated with entry #{entry_id}"
msg = "Error: Importer id #{import_id} does not match id associated with entry #{entry.importerexporter_id}"
return false, msg, paths_compared, nil
end
@@ -124,11 +125,16 @@ class VerifyCRCDatasetImport
# Get files to compare
# -- Get list of files from import directory
input_list = Dir.glob(File.join(import_path, '**', '*')).
reject {|fn| File.directory?(fn) }.
reject{|fn| self.restricted_file_names?(fn.split('/')[-1])}.
map{ |fn| fn.sub(import_path, '')}.sort
# -- Get list of files from import directory including hidden files
input_list = []
::Find.find(import_path) do |fp|
unless FileTest.directory?(fp)
unless self.restricted_file_names?(fp.split('/')[-1])
input_list << fp.sub(import_path, '')
end
end
end
input_list.sort
# ---- downcase folder name
sanitised_input_list = {}
input_list.each do |fp|
Loading