Skip to content

Commit 0c0c87e

Browse files
authored
Merge pull request #1 from HR/dev
fix bugs
2 parents 267b927 + 81d0f64 commit 0c0c87e

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

clone.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
recursive = True
8-
# "https://github.com/HR/Crypter/tree/master/build"
98
base_url = 'https://api.github.com'
109
# /repos/:owner/:repo/git/trees/:sha?recursive=:bool
1110
tree_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

7877
if len(sys.argv) > 1:
79-
gh_url=sys.argv[1]
78+
gh_url = sys.argv[1]
8079
else:
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

9392
print "Fetching sub repo %s..." % (api_req_url)
9493

0 commit comments

Comments
 (0)