MCPcopy Index your code
hub / github.com/nodejs/node / EnsureDepotTools

Function EnsureDepotTools

tools/v8/node_common.py:19–43  ·  view source on GitHub ↗
(v8_path, fetch_if_not_exist)

Source from the content-addressed store, hash-verified

17 "https://chromium.googlesource.com/chromium/tools/depot_tools.git"
18
19def EnsureDepotTools(v8_path, fetch_if_not_exist):
20 def _Get(v8_path):
21 depot_tools = os.path.join(v8_path, "depot_tools")
22 try:
23 gclient_path = os.path.join(depot_tools, "gclient.py")
24 if os.path.isfile(gclient_path):
25 return depot_tools
26 except:
27 pass
28 if fetch_if_not_exist:
29 print("Checking out depot_tools.")
30 # shell=True needed on Windows to resolve git.bat.
31 subprocess.check_call("git clone {} {}".format(
32 pipes.quote(DEPOT_TOOLS_URL),
33 pipes.quote(depot_tools)), shell=True)
34 # Using check_output to hide warning messages.
35 subprocess.check_output(
36 [sys.executable, gclient_path, "metrics", "--opt-out"],
37 cwd=depot_tools)
38 return depot_tools
39 return None
40 depot_tools = _Get(v8_path)
41 assert depot_tools is not None
42 print("Using depot tools in %s" % depot_tools)
43 return depot_tools
44
45def UninitGit(v8_path):
46 print("Uninitializing temporary git repository")

Callers

nothing calls this directly

Calls 2

_GetFunction · 0.85
printFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…