MCPcopy Create free account
hub / github.com/boostorg/build / check_tool_aux

Function check_tool_aux

v2/tools/common.py:393–411  ·  view source on GitHub ↗

Checks if 'command' can be found either in path or is a full name to an existing file.

(command)

Source from the content-addressed store, hash-verified

391
392#ported from trunk@47281
393def check_tool_aux(command):
394 """ Checks if 'command' can be found either in path
395 or is a full name to an existing file.
396 """
397 assert(isinstance(command, str))
398 dirname = os.path.dirname(command)
399 if dirname:
400 if os.path.exists(command):
401 return command
402 # Both NT and Cygwin will run .exe files by their unqualified names.
403 elif on_windows() and os.path.exists(command + '.exe'):
404 return command
405 # Only NT will run .bat files by their unqualified names.
406 elif os_name() == 'NT' and os.path.exists(command + '.bat'):
407 return command
408 else:
409 paths = path.programs_path()
410 if path.glob(paths, [command]):
411 return command
412
413# ported from trunk@47281
414def check_tool(command):

Callers 1

check_toolFunction · 0.85

Calls 2

on_windowsFunction · 0.85
os_nameFunction · 0.85

Tested by

no test coverage detected