15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/packs/update_references_post_processor.rb', line 15
def after_move_files!(file_move_operations)
return if file_move_operations.empty?
origin_pack = T.must(file_move_operations.first).origin_pack&.name || ParsePackwerk::ROOT_PACKAGE_NAME
destination_pack = T.must(file_move_operations.first).destination_pack.name
if self.class.ripgrep_enabled?
matching_files = `rg -l --hidden '#{origin_pack}' .`
matching_files.split("\n").each do |file_name|
substitute_references!(file_name, origin_pack, destination_pack)
end
else
Logging.print('For faster UpdateReferences install ripgrep: https://github.com/BurntSushi/ripgrep/tree/master')
Dir.glob('./**/*', File::FNM_DOTMATCH) do |file_name|
next if File.directory?(file_name)
substitute_references!(file_name, origin_pack, destination_pack)
end
end
end
|