Browse Source

check for the output directory before trying to run any commands

Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Doug Hellmann 11 months ago
parent
commit
dda72e3079
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      git_nit/cmd.py

+ 5
- 0
git_nit/cmd.py View File

@@ -16,7 +16,9 @@ from __future__ import print_function
16 16
 
17 17
 import argparse
18 18
 import json
19
+import os
19 20
 import subprocess
21
+import sys
20 22
 
21 23
 import pkg_resources
22 24
 import requests
@@ -115,6 +117,9 @@ def main():
115 117
     else:
116 118
         clone_to = '{}-{}-{}'.format(short_repo, review, subject)
117 119
 
120
+    if os.path.exists(clone_to):
121
+        sys.exit('{} already exists'.format(clone_to))
122
+
118 123
     git_cmd = [
119 124
         'git',
120 125
         'clone',

Loading…
Cancel
Save