More miscellaneous cleanup

This commit is contained in:
Anthony Sottile 2020-01-12 21:17:59 -08:00
parent 489d9f9926
commit df40e862f4
33 changed files with 209 additions and 296 deletions

View file

@ -34,7 +34,7 @@ def make_archive(name: str, repo: str, ref: str, destdir: str) -> str:
:param text ref: Tag/SHA/branch to check out.
:param text destdir: Directory to place archives in.
"""
output_path = os.path.join(destdir, name + '.tar.gz')
output_path = os.path.join(destdir, f'{name}.tar.gz')
with tmpdir() as tempdir:
# Clone the repository to the temporary directory
cmd_output_b('git', 'clone', repo, tempdir)
@ -56,9 +56,7 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
parser.add_argument('--dest', default='pre_commit/resources')
args = parser.parse_args(argv)
for archive_name, repo, ref in REPOS:
output.write_line(
f'Making {archive_name}.tar.gz for {repo}@{ref}',
)
output.write_line(f'Making {archive_name}.tar.gz for {repo}@{ref}')
make_archive(archive_name, repo, ref, args.dest)
return 0