From a6794da933e0e8b0232e1fb45b154fea1612a194 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 15 Sep 2018 10:30:36 +0800 Subject: [PATCH] 1 --- gitlab/githelper.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gitlab/githelper.py b/gitlab/githelper.py index c885f53..a28132b 100644 --- a/gitlab/githelper.py +++ b/gitlab/githelper.py @@ -18,10 +18,10 @@ for proj in projects: http_url_to_repo = proj['http_url_to_repo'] name = proj['name'] path = proj['namespace']['path'] - if not os.path.exists('repository/' + path): - os.mkdir('repository/' + path) - if not os.path.exists('repository/' + path + '/' + name): - os.system('cd repository/' + path + ' && git clone ' + http_url_to_repo) - os.system('cd repository/' + path + ' && git pull') - os.system('cd repository/' + path + ' && git submodule init') - os.system('cd repository/' + path + ' && git submodule update') + if not os.path.exists('repository/%s' % path): + os.mkdir('repository/%s' % (path)) + if not os.path.exists('repository/%s/%s' % (path, name)): + os.system('cd repository/%s/%s && git clone %s' % (path, name, http_url_to_repo)) + os.system('cd repository/%s/%s && git pull' % (path, name)) + os.system('cd repository/%s/%s && git submodule init' % (path, name)) + os.system('cd repository/%s/%s && git submodule update' % (path, name))