Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit 7e6dbb5

Browse files
authored
Merge pull request #1658 from Homebrew/fix_path
commands/exec: fix PATH-like variable handling.
2 parents 775802d + 916ef9f commit 7e6dbb5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/bundle/commands/exec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def run(*args, global: false, file: nil, subcommand: "")
130130
cellar = "/Cellar/#{formula_name}/#{formula_version}\\1"
131131

132132
# Look for PATH-like environment variables
133-
if key.include?("PATH") && value.match?(PATH_LIKE_ENV_REGEX)
133+
ENV[key] = if key.include?("PATH") && value.match?(PATH_LIKE_ENV_REGEX)
134134
rejected_opts = []
135135
path = PATH.new(ENV.fetch("PATH"))
136136
.reject do |value|
@@ -139,9 +139,9 @@ def run(*args, global: false, file: nil, subcommand: "")
139139
rejected_opts.each do |value|
140140
path.prepend(value.gsub(opt, cellar))
141141
end
142-
ENV["PATH"] = path.to_s
142+
path.to_s
143143
else
144-
ENV[key] = value.gsub(opt, cellar)
144+
value.gsub(opt, cellar)
145145
end
146146
end
147147
end

0 commit comments

Comments
 (0)