Skip to content

Commit

Permalink
gyp: fix XCode CLT version detection on Catalina (nodejs#44)
Browse files Browse the repository at this point in the history
* gyp: fix XCode CLT version detection on Catalina

Copies @szekelyisz nodejs#2141 to this repo.

* Regex loves raw strings

* Update pylib/gyp/xcode_emulation.py

Co-authored-by: Michaël Zasso <targos@protonmail.com>

Co-authored-by: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
cclauss and targos authored Jun 5, 2020
1 parent 064689a commit 208f919
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pylib/gyp/xcode_emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,13 @@ def CLTVersion():
except GypError:
continue

regex = re.compile(r'Command Line Tools for Xcode\s+(?P<version>\S+)')
try:
output = GetStdout(["/usr/sbin/softwareupdate", "--history"])
return re.search(regex, output).groupdict()["version"]
except GypError:
return None


def GetStdoutQuiet(cmdlist):
"""Returns the content of standard output returned by invoking |cmdlist|.
Expand Down

0 comments on commit 208f919

Please sign in to comment.