diff options
author | Oliver Poignant <oliver@poignant.se> | 2015-05-09 23:14:57 +0200 |
---|---|---|
committer | Oliver Poignant <oliver@poignant.se> | 2015-05-09 23:14:57 +0200 |
commit | 72f40fc96e50452b5fa1201c2e5dbf03f84e891e (patch) | |
tree | 0a64a970b8371eaddd4158e724110c6c87c9de10 | |
parent | 4016844083225a3ce55503721143568051050f5b (diff) | |
parent | 1ba822967eb43f0e52316965b117f8bea09b69be (diff) | |
download | Git-Auto-Deploy-72f40fc96e50452b5fa1201c2e5dbf03f84e891e.zip Git-Auto-Deploy-72f40fc96e50452b5fa1201c2e5dbf03f84e891e.tar.gz Git-Auto-Deploy-72f40fc96e50452b5fa1201c2e5dbf03f84e891e.tar.bz2 |
Merge pull request #24 from quizzz-and-chiv/clone
If repo is not yet cloned, try to clone it instead of erroring
-rwxr-xr-x | GitAutoDeploy.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/GitAutoDeploy.py b/GitAutoDeploy.py index 1bc6ead..9f8b26e 100755 --- a/GitAutoDeploy.py +++ b/GitAutoDeploy.py @@ -31,7 +31,12 @@ class GitAutoDeploy(BaseHTTPRequestHandler): for repository in myClass.config['repositories']: if(not os.path.isdir(repository['path'])): print "Directory %s not found" % repository['path'] - sys.exit(2) + call(['git clone '+repository['url']+' '+repository['path']], shell=True) + if(not os.path.isdir(repository['path'])): + print "Unable to clone repository %s" % repository['url'] + sys.exit(2) + else: + print "Repository %s successfully cloned" % repository['url'] if(not os.path.isdir(repository['path'] + '/.git')): print "Directory %s is not a Git repository" % repository['path'] sys.exit(2) |