Merge pull request #17155 from carlocab/no-clobber-sync
cmd/*-sync: avoid clobbering existing user installations
This commit is contained in:
commit
d7350f1fa7
@ -58,6 +58,8 @@ module Homebrew
|
||||
(0..minor_version).each do |minor|
|
||||
(0..patch_version).each do |patch|
|
||||
link_path = nodenv_versions/"#{major_version}.#{minor}.#{patch}"
|
||||
# Don't clobber existing user installations.
|
||||
next if link_path.exist? && !link_path.symlink?
|
||||
|
||||
FileUtils.rm_f link_path
|
||||
FileUtils.ln_sf path, link_path
|
||||
|
@ -56,6 +56,8 @@ module Homebrew
|
||||
|
||||
(0..patch_version).each do |patch|
|
||||
link_path = pyenv_versions/"#{major_version}.#{minor_version}.#{patch}"
|
||||
# Don't clobber existing user installations.
|
||||
next if link_path.exist? && !link_path.symlink?
|
||||
|
||||
FileUtils.rm_f link_path
|
||||
FileUtils.ln_sf path, link_path
|
||||
|
@ -57,6 +57,8 @@ module Homebrew
|
||||
|
||||
(0..patch_version).each do |patch|
|
||||
link_path = rbenv_versions/"#{major_version}.#{minor_version}.#{patch}"
|
||||
# Don't clobber existing user installations.
|
||||
next if link_path.exist? && !link_path.symlink?
|
||||
|
||||
FileUtils.rm_f link_path
|
||||
FileUtils.ln_sf path, link_path
|
||||
|
Loading…
x
Reference in New Issue
Block a user