MCPcopy Create free account
hub / github.com/FastLED/FastLED / run

Function run

ci/docs.py:37–61  ·  view source on GitHub ↗
(
    cmd: str,
    cwd: Optional[str] = None,
    shell: bool = True,
    check: bool = True,
    capture: bool = True,
)

Source from the content-addressed store, hash-verified

35
36
37def run(
38 cmd: str,
39 cwd: Optional[str] = None,
40 shell: bool = True,
41 check: bool = True,
42 capture: bool = True,
43) -> str:
44 print(f"Running: {cmd}")
45 result = subprocess.run(
46 cmd, shell=shell, cwd=cwd, check=False, capture_output=capture, text=False
47 )
48 if capture:
49 stdout = result.stdout.decode("utf-8") if result.stdout else ""
50 stderr = result.stderr.decode("utf-8") if result.stderr else ""
51 else:
52 stdout = ""
53 stderr = ""
54 if result.returncode != 0:
55 msg = f"Command failed with exit code {result.returncode}:\nstdout:\n{stdout}\n\nstderr:\n{stderr}"
56 warnings.warn(msg)
57 if check:
58 raise subprocess.CalledProcessError(
59 result.returncode, cmd, output=result.stdout
60 )
61 return stdout.strip()
62
63
64def get_git_info() -> tuple[str, str]:

Callers 10

get_git_infoFunction · 0.70
install_doxygen_unixFunction · 0.70
install_themeFunction · 0.70
generate_docsFunction · 0.70
mainFunction · 0.70
FL_TEST_FILEFunction · 0.50
updateMethod · 0.50
NetThreadMethod · 0.50
FL_TEST_FILEFunction · 0.50
loopFunction · 0.50

Calls 3

printFunction · 0.50
runMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected