mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-06 08:28:03 +01:00
Moved asset downloading loop inside the if block
This commit is contained in:
@@ -963,11 +963,9 @@ def backup_releases(args, repo_cwd, repository, repos_template, include_assets=F
|
|||||||
if include_assets:
|
if include_assets:
|
||||||
assets = retrieve_data(args, release['assets_url'])
|
assets = retrieve_data(args, release['assets_url'])
|
||||||
if len(assets) > 0:
|
if len(assets) > 0:
|
||||||
# give release asset files somewhere to live
|
# give release asset files somewhere to live & download them (not including source archives)
|
||||||
release_assets_cwd = os.path.join(release_cwd, release_name)
|
release_assets_cwd = os.path.join(release_cwd, release_name)
|
||||||
mkdir_p(release_assets_cwd)
|
mkdir_p(release_assets_cwd)
|
||||||
|
|
||||||
# download any release asset files (not including source archives)
|
|
||||||
for asset in assets:
|
for asset in assets:
|
||||||
download_file(asset['url'], os.path.join(release_assets_cwd, asset['name']), get_auth(args))
|
download_file(asset['url'], os.path.join(release_assets_cwd, asset['name']), get_auth(args))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user