From 3fe55e78132ca79efa89c9000028aa7d72a96698 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Wed, 18 Sep 2024 12:52:04 +0100 Subject: build: T3664: improve support for custom build hooks --- scripts/image-build/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/image-build/utils.py') diff --git a/scripts/image-build/utils.py b/scripts/image-build/utils.py index 7002b281..081327cd 100644 --- a/scripts/image-build/utils.py +++ b/scripts/image-build/utils.py @@ -82,3 +82,10 @@ def cmd(command): res = vyos.utils.process.call(command, shell=True) if res > 0: raise OSError(f"Command '{command}' failed") + +def rc_cmd(command): + code, out = vyos.utils.process.rc_cmd(command, shell=True) + if code > 0: + raise OSError(f"Command '{command}' failed") + else: + return out -- cgit v1.2.3