@@ -127,9 +127,9 @@ def update_bundle(bundle_path):
127
127
128
128
def commit_updates (bundle_path , update_info ):
129
129
working_directory = os .path .abspath (os .getcwd ())
130
- os .chdir (bundle_path )
131
130
message = ["Automated update by Adabot (adafruit/adabot@{})"
132
131
.format (repo_version ())]
132
+ os .chdir (bundle_path )
133
133
for url , old_commit , new_commit , summary in update_info :
134
134
url_parts = url .split ("/" )
135
135
user , repo = url_parts [- 2 :]
@@ -163,21 +163,24 @@ def get_contributors(repo, commit_range):
163
163
if not author or not committer :
164
164
github_commit_info = github .get ("/repos/" + repo + "/commits/" + sha )
165
165
github_commit_info = github_commit_info .json ()
166
- author = github_commit_info ["author" ]["login" ]
167
- committer = github_commit_info ["committer" ]["login" ]
168
- redis .set ("github_username:" + author_email , author )
169
- redis .set ("github_username:" + committer_email , committer )
166
+ if github_commit_info ["author" ]:
167
+ author = github_commit_info ["author" ]["login" ]
168
+ redis .set ("github_username:" + author_email , author )
169
+ if github_commit_info ["committer" ]:
170
+ committer = github_commit_info ["committer" ]["login" ]
171
+ redis .set ("github_username:" + committer_email , committer )
170
172
else :
171
173
author = author .decode ("utf-8" )
172
174
committer = committer .decode ("utf-8" )
173
175
174
176
if committer_email == "[email protected] " :
175
177
committer = None
176
- if author not in contributors :
178
+ if author and author not in contributors :
177
179
contributors [author ] = 0
178
180
if committer and committer not in contributors :
179
181
contributors [committer ] = 0
180
- contributors [author ] += 1
182
+ if author :
183
+ contributors [author ] += 1
181
184
if committer and committer != author :
182
185
contributors [committer ] += 1
183
186
return contributors
@@ -276,9 +279,9 @@ def new_release(bundle, bundle_path):
276
279
os .chdir (working_directory )
277
280
278
281
if __name__ == "__main__" :
279
- directory = ".bundles"
282
+ directory = os . path . abspath ( ".bundles" )
280
283
for bundle in bundles :
281
- bundle_path = os .path .abspath ( os . path . join (directory , bundle ) )
284
+ bundle_path = os .path .join (directory , bundle )
282
285
fetch_bundle (bundle , bundle_path )
283
286
update_info = update_bundle (bundle_path )
284
287
if update_info :
0 commit comments