def _download_repo(repo_path):
"""
Download Google's repo.
"""
logger.info('Fetching repo')
repo_url = CONSTANTS['repo']['url']
response = requests.get(repo_url)
if response.status_code != 200:
raise CommandError('Unable to download repo from %s' % repo_url)
with open(repo_path, 'wb') as f:
f.write(response.content)
logger.success('Fetched repo')
# Ensure that the repo binary is executable
st = os.stat(repo_path)
os.chmod(repo_path, st.st_mode | stat.S_IEXEC)
评论列表
文章目录