fix small bug where this would break if git stage has deleted files
This commit is contained in:
+4
-1
@@ -16,8 +16,11 @@ def run_command(cmd):
|
|||||||
"""Run a shell command and return output, or None if it fails."""
|
"""Run a shell command and return output, or None if it fails."""
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=5)
|
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=5)
|
||||||
if result.returncode == 0:
|
# Return stdout if we got output (even if some files in xargs failed)
|
||||||
|
if result.stdout.strip():
|
||||||
return result.stdout.strip()
|
return result.stdout.strip()
|
||||||
|
if result.returncode == 0:
|
||||||
|
return ""
|
||||||
return None
|
return None
|
||||||
except:
|
except:
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user