check for the output directory before trying to run any commands

Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-04-26 16:27:40 -04:00
parent 4b6b5bc8bf
commit dda72e3079
1 changed files with 5 additions and 0 deletions

View File

@ -16,7 +16,9 @@ from __future__ import print_function
import argparse
import json
import os
import subprocess
import sys
import pkg_resources
import requests
@ -115,6 +117,9 @@ def main():
else:
clone_to = '{}-{}-{}'.format(short_repo, review, subject)
if os.path.exists(clone_to):
sys.exit('{} already exists'.format(clone_to))
git_cmd = [
'git',
'clone',