Merge pull request #16210 from carlocab/vendor-symlinks
dev-cmd/vendor-gems: fix creation of broken symlinks
This commit is contained in:
commit
d26056bd9f
@ -59,12 +59,16 @@ module Homebrew
|
|||||||
mechanize
|
mechanize
|
||||||
].each do |gem|
|
].each do |gem|
|
||||||
ohai "gem install #{gem}"
|
ohai "gem install #{gem}"
|
||||||
safe_system "gem", "install", "mechanize", "--install-dir", "vendor",
|
safe_system "gem", "install", gem, "--install-dir", "vendor",
|
||||||
"--no-document", "--no-wrappers", "--ignore-dependencies", "--force"
|
"--no-document", "--no-wrappers", "--ignore-dependencies", "--force"
|
||||||
(HOMEBREW_LIBRARY_PATH/"vendor/gems").cd do
|
(HOMEBREW_LIBRARY_PATH/"vendor/gems").cd do
|
||||||
if (source = Pathname.glob("#{gem}-*/").first)
|
source = Pathname.glob("#{gem}-*/").first
|
||||||
FileUtils.ln_sf source, gem
|
next if source.blank?
|
||||||
end
|
|
||||||
|
# We cannot use `#ln_sf` here because that has unintended consequences when
|
||||||
|
# the symlink we want to create exists and points to an existing directory.
|
||||||
|
FileUtils.rm_f gem
|
||||||
|
FileUtils.ln_s source, gem
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
mechanize-2.9.1/
|
|
||||||
Loading…
x
Reference in New Issue
Block a user