Skip to content

Commit

Permalink
Fix delete, add output to delete and upload
Browse files Browse the repository at this point in the history
  • Loading branch information
j0057 committed Aug 13, 2014
1 parent 43d46a5 commit 810ef1d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion github_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def gh_release_notes(repo_name, tag_name):
def gh_asset_upload(repo_name, tag_name, pattern):
release = get_release_info(repo_name, tag_name)
for filename in glob.glob(pattern):
print 'release {0}: uploading {1}'.format(tag_name, filename)
with open(filename, 'rb') as f:
basename = os.path.basename(filename)
response = request('POST',
Expand All @@ -126,10 +127,11 @@ def gh_asset_upload(repo_name, tag_name, pattern):
response.raise_for_status()

def gh_asset_erase(repo_name, tag_name, pattern):
release = get_releases(repo_name)
release = get_release_info(repo_name, tag_name)
for asset in release['assets']:
if not fnmatch.fnmatch(asset['name'], pattern):
continue
print 'release {0}: deleting {1}'.format(tag_name, asset['name'])
response = request('DELETE',
'https://api.github.com/repos/{0}/releases/assets/{1}'.format(repo_name, asset['id']))
response.raise_for_status()
Expand Down

0 comments on commit 810ef1d

Please sign in to comment.