From 810ef1d45694fb06056f76546f77c5020d215866 Mon Sep 17 00:00:00 2001 From: Joost Molenaar Date: Wed, 13 Aug 2014 16:47:58 +0200 Subject: [PATCH] Fix delete, add output to delete and upload --- github_release.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/github_release.py b/github_release.py index 4b12f0e..dc7a611 100755 --- a/github_release.py +++ b/github_release.py @@ -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', @@ -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()