From f24c77f3dda5630fbe6d07ec254574648bb22128 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 1 Jun 2018 16:43:11 +0100 Subject: [PATCH] Formula#update_head_version: fix PATH. Ensure that all the necessary tools are accessible. --- Library/Homebrew/formula.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 2e89d14197..00a7f0a9eb 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -358,7 +358,15 @@ class Formula return unless head.downloader.is_a?(VCSDownloadStrategy) return unless head.downloader.cached_location.exist? - head.version.update_commit(head.downloader.last_commit) + path = if ENV["HOMEBREW_ENV"] + ENV["PATH"] + else + ENV["HOMEBREW_PATH"] + end + + with_env(PATH: path) do + head.version.update_commit(head.downloader.last_commit) + end end # The {PkgVersion} for this formula with {version} and {#revision} information.