MCPcopy Create free account
hub / github.com/ClangBuiltLinux/boot-utils / check_cmd

Function check_cmd

utils.py:21–32  ·  view source on GitHub ↗

Checks if external command is available in PATH, erroring out if it is not available. Parameters: cmd (str): External command name or path.

(cmd: str)

Source from the content-addressed store, hash-verified

19
20
21def check_cmd(cmd: str) -> None:
22 """
23 Checks if external command is available in PATH, erroring out if it is not
24 available.
25
26 Parameters:
27 cmd (str): External command name or path.
28 """
29 if not shutil.which(cmd):
30 die(
31 f"The external command '{cmd}' is needed but it could not be found in PATH, please install it!"
32 )
33
34
35def die(string: str) -> NoReturn:

Callers 1

prepare_initrdFunction · 0.85

Calls 1

dieFunction · 0.85

Tested by

no test coverage detected