Skip to content

Commit cc574a6

Browse files
committed
gh_asset_upload: Support verbose option
1 parent 802b894 commit cc574a6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

github_release.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def print_asset_info(i, asset):
352352
print('')
353353

354354

355-
def gh_asset_upload(repo_name, tag_name, pattern, dry_run=False):
355+
def gh_asset_upload(repo_name, tag_name, pattern, dry_run=False, verbose=False):
356356
release = get_release_info(repo_name, tag_name)
357357
uploaded = False
358358
upload_url = release["upload_url"]
@@ -375,7 +375,8 @@ def gh_asset_upload(repo_name, tag_name, pattern, dry_run=False):
375375
with open(filename, 'rb') as f:
376376
basename = os.path.basename(filename)
377377
url = '{0}?name={1}'.format(upload_url, basename)
378-
print('url:', url)
378+
if verbose:
379+
print('url:', url)
379380
response = _request(
380381
'POST', url,
381382
headers={'Content-Type': 'application/octet-stream'},
@@ -391,8 +392,8 @@ def gh_asset_upload(repo_name, tag_name, pattern, dry_run=False):
391392

392393
gh_asset_upload.description = {
393394
"help": "Upload release assets",
394-
"params": ["repo_name", "tag_name", "pattern", "dry-run"],
395-
"optional_params": {"dry-run": bool}
395+
"params": ["repo_name", "tag_name", "pattern", "dry-run", "verbose"],
396+
"optional_params": {"dry-run": bool, "verbose": bool}
396397
}
397398

398399

0 commit comments

Comments
 (0)