Merge pull request #17155 from carlocab/no-clobber-sync

cmd/*-sync: avoid clobbering existing user installations
This commit is contained in:
Mike McQuaid 2024-04-26 15:03:15 +01:00 committed by GitHub
commit d7350f1fa7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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