Merge pull request #4046 from xu-cheng/keg_relocate
Keg#replace_text_in_files: fix incorrect replace order
This commit is contained in:
commit
07794cd7f8
@ -68,7 +68,7 @@ class Keg
|
|||||||
relocation.old_cellar => relocation.new_cellar,
|
relocation.old_cellar => relocation.new_cellar,
|
||||||
relocation.old_repository => relocation.new_repository,
|
relocation.old_repository => relocation.new_repository,
|
||||||
}
|
}
|
||||||
changed = s.gsub!(Regexp.union(replacements.keys), replacements)
|
changed = s.gsub!(Regexp.union(replacements.keys.sort_by(&:length).reverse), replacements)
|
||||||
next unless changed
|
next unless changed
|
||||||
changed_files += [first, *rest].map { |file| file.relative_path_from(path) }
|
changed_files += [first, *rest].map { |file| file.relative_path_from(path) }
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user