diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-09-09 17:42:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-09 17:42:26 +0200 |
| commit | 1769a425fb70aea008126ec4be2a9ecc3ade87a1 (patch) | |
| tree | c65124be3c3b552c984e47fea3508e3213f6c5a5 | |
| parent | 7e98ec507932a250b421257f2200c457949b4c99 (diff) | |
| parent | b117bd7366b38061ec91697f9f2c6d1736e01aa4 (diff) | |
| download | rust-1769a425fb70aea008126ec4be2a9ecc3ade87a1.tar.gz rust-1769a425fb70aea008126ec4be2a9ecc3ade87a1.zip | |
Rollup merge of #64278 - guanqun:check-git, r=Mark-Simulacrum
check git in bootstrap.py
| -rw-r--r-- | src/bootstrap/bootstrap.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 14bc90700b7..65129eeeec5 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -708,6 +708,14 @@ class RustBuild(object): if (not os.path.exists(os.path.join(self.rust_root, ".git"))) or \ self.get_toml('submodules') == "false": return + + # check the existence of 'git' command + try: + subprocess.check_output(['git', '--version']) + except (subprocess.CalledProcessError, OSError): + print("error: `git` is not found, please make sure it's installed and in the path.") + sys.exit(1) + slow_submodules = self.get_toml('fast-submodules') == "false" start_time = time() if slow_submodules: |
