Skip to content

Commit 31f39ec

Browse files
authored
Merge pull request #525 from mrexodia/gist-fix
Fix exception when DMCA'd starred gists are backed up
2 parents ba2e17c + 83ef000 commit 31f39ec

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

github_backup/github_backup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2109,7 +2109,10 @@ def backup_repositories(args, output_directory, repositories):
21092109
)
21102110

21112111
if repository.get("is_gist"):
2112-
# dump gist information to a file as well
2112+
# dump gist information to a file as well; the clone may have
2113+
# been skipped (e.g. DMCA-blocked or empty gist), so make sure
2114+
# the directory exists
2115+
mkdir_p(repo_cwd)
21132116
output_file = "{0}/gist.json".format(repo_cwd)
21142117
with codecs.open(output_file, "w", encoding="utf-8") as f:
21152118
json_dump(repository, f)

0 commit comments

Comments
 (0)