From 507d54224ad8d736c07fb7b01e5a1dcf46893922 Mon Sep 17 00:00:00 2001 From: Andrej Karpathy Date: Sun, 4 Jan 2026 19:11:43 +0000 Subject: [PATCH] fix small bug where this would break if git stage has deleted files --- nanochat/report.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nanochat/report.py b/nanochat/report.py index 6773f0b..1a31aa4 100644 --- a/nanochat/report.py +++ b/nanochat/report.py @@ -16,8 +16,11 @@ def run_command(cmd): """Run a shell command and return output, or None if it fails.""" try: 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() + if result.returncode == 0: + return "" return None except: return None