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

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

Callers 1

prepare_initrdFunction · 0.85

Calls 1

dieFunction · 0.85

Tested by

no test coverage detected