Skip to content

Commit

Permalink
cmd/*env-sync: use *ENV_ROOT
Browse files Browse the repository at this point in the history
Fixes #16428
  • Loading branch information
MikeMcQuaid committed Jan 9, 2024
1 parent b3751bc commit 06752f0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Library/Homebrew/cmd/nodenv-sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ def nodenv_sync_args

sig { void }
def nodenv_sync
dot_nodenv = Pathname(Dir.home)/".nodenv"
nodenv_root = Pathname(ENV.fetch("HOMEBREW_NODENV_ROOT", Pathname(Dir.home)/".nodenv"))

Check warning on line 26 in Library/Homebrew/cmd/nodenv-sync.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/nodenv-sync.rb#L26

Added line #L26 was not covered by tests

# Don't run multiple times at once.
nodenv_sync_running = dot_nodenv/".nodenv_sync_running"
nodenv_sync_running = nodenv_root/".nodenv_sync_running"

Check warning on line 29 in Library/Homebrew/cmd/nodenv-sync.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/nodenv-sync.rb#L29

Added line #L29 was not covered by tests
return if nodenv_sync_running.exist?

begin
nodenv_versions = dot_nodenv/"versions"
nodenv_versions = nodenv_root/"versions"

Check warning on line 33 in Library/Homebrew/cmd/nodenv-sync.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/nodenv-sync.rb#L33

Added line #L33 was not covered by tests
nodenv_versions.mkpath
FileUtils.touch nodenv_sync_running

Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/cmd/pyenv-sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ def pyenv_sync_args

sig { void }
def pyenv_sync
dot_pyenv = Pathname(Dir.home)/".pyenv"
pyenv_root = Pathname(ENV.fetch("HOMEBREW_PYENV_ROOT", Pathname(Dir.home)/".pyenv"))

Check warning on line 26 in Library/Homebrew/cmd/pyenv-sync.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/pyenv-sync.rb#L26

Added line #L26 was not covered by tests

# Don't run multiple times at once.
pyenv_sync_running = dot_pyenv/".pyenv_sync_running"
pyenv_sync_running = pyenv_root/".pyenv_sync_running"

Check warning on line 29 in Library/Homebrew/cmd/pyenv-sync.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/pyenv-sync.rb#L29

Added line #L29 was not covered by tests
return if pyenv_sync_running.exist?

begin
pyenv_versions = dot_pyenv/"versions"
pyenv_versions = pyenv_root/"versions"

Check warning on line 33 in Library/Homebrew/cmd/pyenv-sync.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/pyenv-sync.rb#L33

Added line #L33 was not covered by tests
pyenv_versions.mkpath
FileUtils.touch pyenv_sync_running

Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/cmd/rbenv-sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ def rbenv_sync_args

sig { void }
def rbenv_sync
dot_rbenv = Pathname(Dir.home)/".rbenv"
rbenv_root = Pathname(ENV.fetch("HOMEBREW_RBENV_ROOT", Pathname(Dir.home)/".rbenv"))

Check warning on line 26 in Library/Homebrew/cmd/rbenv-sync.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/rbenv-sync.rb#L26

Added line #L26 was not covered by tests

# Don't run multiple times at once.
rbenv_sync_running = dot_rbenv/".rbenv_sync_running"
rbenv_sync_running = rbenv_root/".rbenv_sync_running"

Check warning on line 29 in Library/Homebrew/cmd/rbenv-sync.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/rbenv-sync.rb#L29

Added line #L29 was not covered by tests
return if rbenv_sync_running.exist?

begin
rbenv_versions = dot_rbenv/"versions"
rbenv_versions = rbenv_root/"versions"

Check warning on line 33 in Library/Homebrew/cmd/rbenv-sync.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/cmd/rbenv-sync.rb#L33

Added line #L33 was not covered by tests
rbenv_versions.mkpath
FileUtils.touch rbenv_sync_running

Expand Down
3 changes: 3 additions & 0 deletions bin/brew
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ USED_BY_HOMEBREW_VARS=(
CODESPACES
COLORTERM
DBUS_SESSION_BUS_ADDRESS
NODENV_ROOT
PATH
PYENV_ROOT
RBENV_ROOT
SSH_TTY
SUDO_USER
TMUX
Expand Down

0 comments on commit 06752f0

Please sign in to comment.