MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / _install_dir

Function _install_dir

pre_commit/languages/dart.py:48–65  ·  view source on GitHub ↗
(prefix_p: Prefix, pub_cache: str)

Source from the content-addressed store, hash-verified

46 bin_dir = os.path.join(envdir, 'bin')
47
48 def _install_dir(prefix_p: Prefix, pub_cache: str) -> None:
49 dart_env = {**os.environ, 'PUB_CACHE': pub_cache}
50
51 with open(prefix_p.path('pubspec.yaml')) as f:
52 pubspec_contents = yaml_load(f)
53
54 lang_base.setup_cmd(prefix_p, ('dart', 'pub', 'get'), env=dart_env)
55
56 for executable in pubspec_contents['executables']:
57 lang_base.setup_cmd(
58 prefix_p,
59 (
60 'dart', 'compile', 'exe',
61 '--output', os.path.join(bin_dir, win_exe(executable)),
62 prefix_p.path('bin', f'{executable}.dart'),
63 ),
64 env=dart_env,
65 )
66
67 os.makedirs(bin_dir)
68

Callers 1

install_environmentFunction · 0.85

Calls 2

win_exeFunction · 0.90
pathMethod · 0.80

Tested by

no test coverage detected