MCPcopy Create free account
hub / github.com/ElementsProject/elements / determine_wellknown_cmd

Function determine_wellknown_cmd

contrib/devtools/utils.py:14–22  ·  view source on GitHub ↗
(envvar, progname)

Source from the content-addressed store, hash-verified

12
13
14def determine_wellknown_cmd(envvar, progname) -> List[str]:
15 maybe_env = os.getenv(envvar)
16 maybe_which = shutil.which(progname)
17 if maybe_env:
18 return maybe_env.split(' ') # Well-known vars are often meant to be word-split
19 elif maybe_which:
20 return [ maybe_which ]
21 else:
22 sys.exit(f"{progname} not found")

Callers 6

test_ELFMethod · 0.90
test_MACHOMethod · 0.90
test_PEMethod · 0.90
test_ELFMethod · 0.90
test_PEMethod · 0.90
test_MACHOMethod · 0.90

Calls

no outgoing calls

Tested by 6

test_ELFMethod · 0.72
test_MACHOMethod · 0.72
test_PEMethod · 0.72
test_ELFMethod · 0.72
test_PEMethod · 0.72
test_MACHOMethod · 0.72