You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
depot_tools/testing_support/fake_cipd.py

31 lines
694 B
Python

#!/usr/bin/env python
# Copyright (c) 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import shutil
import sys
def main():
assert sys.argv[1] == 'ensure'
parser = argparse.ArgumentParser()
parser.add_argument('-ensure-file')
parser.add_argument('-root')
args, _ = parser.parse_known_args()
cipd_root = os.path.join(args.root, '.cipd')
if not os.path.isdir(cipd_root):
os.makedirs(cipd_root)
if args.ensure_file:
shutil.copy(args.ensure_file, os.path.join(cipd_root, 'ensure'))
return 0
if __name__ == '__main__':
sys.exit(main())