From 28537034e8abd784bfb874c3b9e8830a53963c63 Mon Sep 17 00:00:00 2001 From: Abhay Sundaram Date: Fri, 13 Mar 2020 21:52:12 +0530 Subject: [PATCH] Fix git not found error on Windows when running gclient (#728) It happens if `git` is not installed as a standard alone application, but as a shell command. Fixes #724. --- packager/version/generate_version_string.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packager/version/generate_version_string.py b/packager/version/generate_version_string.py index 214a7e36ee..814dec3b8a 100755 --- a/packager/version/generate_version_string.py +++ b/packager/version/generate_version_string.py @@ -32,8 +32,8 @@ if 'check_output' not in dir(subprocess): if __name__ == '__main__': try: version_tag = subprocess.check_output( - ['git', 'tag', '--points-at', 'HEAD'], - stderr=subprocess.STDOUT).rstrip() + 'git tag --points-at HEAD', + stderr=subprocess.STDOUT, shell=True).rstrip() except subprocess.CalledProcessError as e: # git tag --points-at is not supported in old versions of git. Just ignore # version_tag in this case. @@ -41,8 +41,8 @@ if __name__ == '__main__': try: version_hash = subprocess.check_output( - ['git', 'rev-parse', '--short', 'HEAD'], - stderr=subprocess.STDOUT).rstrip() + 'git rev-parse --short HEAD', + stderr=subprocess.STDOUT, shell=True).rstrip() except subprocess.CalledProcessError as e: version_hash = 'unknown-version'