55
66
77recursive = True
8- # "https://github.com/HR/Crypter/tree/master/build"
98base_url = 'https://api.github.com'
109# /repos/:owner/:repo/git/trees/:sha?recursive=:bool
1110tree_endpoint = base_url + '/repos/{}/{}/git/trees/{}?recursive={}'
@@ -67,7 +66,7 @@ def fetch(base_url, path=None):
6766 # create dir and then fetch recursively
6867 print 'Walking dir: %s' % item ['path' ]
6968 path = joinp (path , item ['path' ])
70- fetch (joinp (base_url , path )
69+ fetch (joinp (base_url , path ))
7170 else :
7271 # download it
7372 # Ensure dir directory exists locally
@@ -76,19 +75,19 @@ def fetch(base_url, path=None):
7675
7776
7877if len (sys .argv ) > 1 :
79- gh_url = sys .argv [1 ]
78+ gh_url = sys .argv [1 ]
8079else :
8180 exit_with_m ('Nothing to clone :(' )
8281
8382# Normalize & parse input
84- norm_gh_url = re .sub (base_normalize_regex , '' , gh_url )
85- gh_url_comps = norm_gh_url .split ('/' )
86- user , repo = gh_url_comps [:2 ]
87- branch = gh_url_comps [3 ]
88- path = joinp (gh_url_comps [4 :])
83+ norm_gh_url = re .sub (base_normalize_regex , '' , gh_url )
84+ gh_url_comps = norm_gh_url .split ('/' )
85+ user , repo = gh_url_comps [:2 ]
86+ branch = gh_url_comps [3 ]
87+ path = joinp (gh_url_comps [4 :])
8988
9089
91- api_req_url = contents_endpoint .format (user , repo )
90+ api_req_url = contents_endpoint .format (user , repo )
9291
9392print "Fetching sub repo %s..." % (api_req_url )
9493
0 commit comments