mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Fix inreplace and yajl formula
This commit is contained in:
parent
7653d48443
commit
bae67c110f
@ -116,13 +116,10 @@ ENV.extend HomebrewEnvExtension
|
|||||||
|
|
||||||
def inreplace(path, before, after)
|
def inreplace(path, before, after)
|
||||||
before=Regexp.escape before.to_s
|
before=Regexp.escape before.to_s
|
||||||
after=Regexp.escape after.to_s
|
after.gsub! "\\", "\\\\"
|
||||||
before.gsub! "/", "\\\/"
|
after.gsub! "/", "\\/"
|
||||||
after.gsub! "/", "\\\/"
|
|
||||||
before.gsub! "'", '\''
|
|
||||||
after.gsub! "'", '\''
|
|
||||||
|
|
||||||
# TODO this sucks
|
# TODO this sucks
|
||||||
# either use 'ed', or allow regexp and use a proper ruby function
|
# either use 'ed', or allow regexp and use a proper ruby function
|
||||||
`perl -pi -e $'s/#{before}/#{after}/g' "#{path}"`
|
Kernel.system "perl", "-pi", "-e", "s/#{before}/#{after}/g", path
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user