doctor: check for 'cipd' in PATH.

Also add the cipd installation folder to PATH.

Change-Id: I871b466079250473c41adcba61bd8787305c795f
This commit is contained in:
Rob Mohr 2020-01-07 09:18:57 -08:00
parent 7d1deb1b9d
commit d527f91e21
2 changed files with 5 additions and 1 deletions

View File

@ -89,7 +89,7 @@ def update(argv=None):
if not os.path.isdir(args.install_dir):
os.makedirs(args.install_dir)
paths = []
paths = [args.install_dir]
env = {
'CIPD_INSTALL_DIR': args.install_dir,
'CIPD_CACHE_DIR': args.cache_dir,

View File

@ -109,6 +109,10 @@ def cipd(ctx: DoctorContext):
"""Check cipd is set up correctly and in use."""
cipd_path = 'pigweed'
cipd_exe = shutil.which('cipd')
if not cipd_exe:
ctx.fatal('cipd not in PATH')
temp = tempfile.NamedTemporaryFile(prefix='cipd', delete=False)
subprocess.run(['cipd', 'acl-check', '-json-output', temp.name, cipd_path],
stdout=subprocess.PIPE)