Fix single process logic in rbenv-sync and nodenv-sync

This commit is contained in:
John Britton 2023-06-29 09:54:18 -04:00
parent 03b455f460
commit 24c014b506
No known key found for this signature in database
GPG Key ID: 0EDB5B1148D612F2
2 changed files with 30 additions and 26 deletions

View File

@ -29,6 +29,7 @@ module Homebrew
nodenv_sync_running = dot_nodenv/".nodenv_sync_running" nodenv_sync_running = dot_nodenv/".nodenv_sync_running"
return if nodenv_sync_running.exist? return if nodenv_sync_running.exist?
begin
nodenv_versions = dot_nodenv/"versions" nodenv_versions = dot_nodenv/"versions"
nodenv_versions.mkpath nodenv_versions.mkpath
FileUtils.touch nodenv_sync_running FileUtils.touch nodenv_sync_running
@ -46,6 +47,7 @@ module Homebrew
ensure ensure
nodenv_sync_running.unlink if nodenv_sync_running.exist? nodenv_sync_running.unlink if nodenv_sync_running.exist?
end end
end
sig { params(path: Pathname, nodenv_versions: Pathname).void } sig { params(path: Pathname, nodenv_versions: Pathname).void }
def link_nodenv_versions(path, nodenv_versions) def link_nodenv_versions(path, nodenv_versions)

View File

@ -29,6 +29,7 @@ module Homebrew
rbenv_sync_running = dot_rbenv/".rbenv_sync_running" rbenv_sync_running = dot_rbenv/".rbenv_sync_running"
return if rbenv_sync_running.exist? return if rbenv_sync_running.exist?
begin
rbenv_versions = dot_rbenv/"versions" rbenv_versions = dot_rbenv/"versions"
rbenv_versions.mkpath rbenv_versions.mkpath
FileUtils.touch rbenv_sync_running FileUtils.touch rbenv_sync_running
@ -46,6 +47,7 @@ module Homebrew
ensure ensure
rbenv_sync_running.unlink if rbenv_sync_running.exist? rbenv_sync_running.unlink if rbenv_sync_running.exist?
end end
end
sig { params(path: Pathname, rbenv_versions: Pathname).void } sig { params(path: Pathname, rbenv_versions: Pathname).void }
def link_rbenv_versions(path, rbenv_versions) def link_rbenv_versions(path, rbenv_versions)