fix(git_helper): surface git stderr and use portable exit code

- Redirect exception output to stderr for diagnostic visibility
- Surface GitCommandError.stderr when available
- Use sys.exit(1) instead of sys.exit(-1) for portable exit codes
- Remove debug print statements
This commit is contained in:
Dr.Lt.Data 2026-03-21 09:20:18 +09:00
parent e129697151
commit 5d34e76aa0

View File

@ -50,9 +50,6 @@ working_directory = os.getcwd()
if os.path.basename(working_directory) != 'custom_nodes':
print("WARN: This script should be executed in custom_nodes dir")
print(f"DBG: INFO {working_directory}")
print(f"DBG: INFO {sys.argv}")
# exit(-1)
class GitProgress(RemoteProgress):
@ -557,7 +554,9 @@ try:
restore_pip_snapshot(pips, options)
sys.exit(0)
except Exception as e:
print(e)
sys.exit(-1)
print(e, file=sys.stderr)
if hasattr(e, 'stderr') and e.stderr:
print(e.stderr, file=sys.stderr)
sys.exit(1)