Skip to content

Commit 0f4a172

Browse files
committed
fix(script): Capture stderr and stdout
1 parent 3c8f4fb commit 0f4a172

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

packages.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ packages:
102102
- 2.3.0
103103
- 2.4.0
104104
- 2.5.0
105-
- 2.6.0
106105
- name: Keyfactor.Platform.IOrchestratorJobCompleteHandler
107106
versions:
108107
- 1.0.0.1

scripts/sync_nuget.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ def download_package(self, name, version):
9292
"-DirectDownload",
9393
"-ConfigFile", config_path,
9494
]
95-
subprocess.run(cmd, check=True)
95+
result = subprocess.run(cmd, check=True, capture_output=True, text=True)
96+
if result.stdout:
97+
print(result.stdout)
9698
# Find the downloaded .nupkg file
9799
pkg_dir = os.path.join(self.TMP_DIR, f"{name}.{version}")
98100
for file in os.listdir(pkg_dir):
@@ -198,6 +200,13 @@ def sync_packages(self):
198200
successful += 1
199201
else:
200202
failed += 1
203+
except subprocess.CalledProcessError as e:
204+
print(f"Failed to sync {pkg_name} {version}: exit code {e.returncode}")
205+
if e.stdout:
206+
print(e.stdout)
207+
if e.stderr:
208+
print(e.stderr)
209+
failed += 1
201210
except Exception as e:
202211
print(f"Failed to sync {pkg_name} {version}: {e}")
203212
failed += 1

0 commit comments

Comments
 (0)