This commit is contained in:
aozhiwei 2018-09-14 21:08:30 +08:00
parent d735b1e1ed
commit 4f2dc9683c

View File

@ -1,3 +1,4 @@
import os
import json
import urllib.request
@ -14,4 +15,11 @@ projects = httpGet('http://git.kingsome.cn/api/v4/projects?',
'per_page': 1000
})
for proj in projects:
print(proj['path_with_namespace'])
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')