From 16a6f461315634a7de8a3aaa90fbb786293e5cbc Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Tue, 3 Mar 2026 17:30:47 +0800 Subject: [PATCH] emacs: exit update-from-overlay.py if subprocess fails to run --- .../emacs/elisp-packages/update-from-overlay.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/editors/emacs/elisp-packages/update-from-overlay.py b/pkgs/applications/editors/emacs/elisp-packages/update-from-overlay.py index 8719a66d5950..36a20c50a49b 100755 --- a/pkgs/applications/editors/emacs/elisp-packages/update-from-overlay.py +++ b/pkgs/applications/editors/emacs/elisp-packages/update-from-overlay.py @@ -58,7 +58,7 @@ class EmacsOverlay: def master_sha(self) -> str: """Return the SHA of current master tip.""" cmdline = ["git", "ls-remote", "--branches", self.git_url, "refs/heads/master"] - result = subprocess.run(cmdline, capture_output=True, text=True) + result = subprocess.run(cmdline, capture_output=True, text=True, check=True) return result.stdout.split()[0] @@ -69,7 +69,7 @@ class HereDirectory: def git_root(self) -> pathlib.Path: """Returns the root directory of Git repository.""" cmdline = ["git", "rev-parse", "--show-toplevel"] - result = subprocess.run(cmdline, capture_output=True, text=True) + result = subprocess.run(cmdline, capture_output=True, text=True, check=True) return pathlib.Path(result.stdout.rstrip()).resolve() @@ -230,7 +230,7 @@ def check_fileset( logger.info(f"Testing {nix_attr}") # TODO: capture the output (to put it in the logfile). - result = subprocess.run(cmdline, capture_output=True, text=True) + result = subprocess.run(cmdline, capture_output=True, text=True, check=True) logger.debug(f""" Shell Command: {result.args} Output: @@ -275,7 +275,9 @@ def commit_fileset( emacs-overlay commit: {sha} """ cmdline_commit = ["git", "commit", "--message", commit_message, "--", basename] - result_commit = subprocess.run(cmdline_commit, capture_output=True, text=True) + result_commit = subprocess.run( + cmdline_commit, capture_output=True, text=True, check=True + ) logger.info(f"File {basename} committed") logger.debug(f""" Shell Command: {result_commit.args}