|
7 | 7 |
|
8 | 8 | def run_command(command, check=True): |
9 | 9 | print(f"Executing: {' '.join(command)}") |
10 | | - result = subprocess.run(command, capture_output=True, text=True, check=check) |
11 | | - if result.stdout: |
12 | | - print(result.stdout) |
13 | | - if result.stderr: |
14 | | - print(result.stderr, file=sys.stderr) |
15 | | - return result.stdout.strip() |
| 10 | + try: |
| 11 | + result = subprocess.run( |
| 12 | + command, capture_output=True, text=True, check=check, encoding="utf-8" |
| 13 | + ) |
| 14 | + if result.stdout: |
| 15 | + print(result.stdout) |
| 16 | + if result.stderr: |
| 17 | + print(result.stderr, file=sys.stderr) |
| 18 | + return result.stdout.strip() |
| 19 | + except subprocess.CalledProcessError as e: |
| 20 | + print("Command failed with a non-zero exit code.", file=sys.stderr) |
| 21 | + if e.stdout: |
| 22 | + print("--- STDOUT ---", file=sys.stderr) |
| 23 | + print(e.stdout, file=sys.stderr) |
| 24 | + if e.stderr: |
| 25 | + print("--- STDERR ---", file=sys.stderr) |
| 26 | + print(e.stderr, file=sys.stderr) |
| 27 | + raise |
16 | 28 |
|
17 | 29 |
|
18 | 30 | def main(): |
@@ -73,8 +85,13 @@ def main(): |
73 | 85 | else: |
74 | 86 | print("Skipped pushing the commit for updating the next version") |
75 | 87 |
|
| 88 | + print("\n--- Start Debugging Info ---") |
| 89 | + run_command(["git", "config", "--list"]) |
| 90 | + run_command(["git", "remote", "-v"]) |
| 91 | + print("--- End Debugging Info ---\n") |
| 92 | + |
76 | 93 | print("Pushing tag to remote") |
77 | | - run_command(["git", "push", "origin", tag]) |
| 94 | + run_command(["git", "push", "--verbose", "origin", tag]) |
78 | 95 |
|
79 | 96 | print("\nRelease process completed successfully!") |
80 | 97 | print(f"Tagged: {tag}") |
|
0 commit comments