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

Function write_executable

tests/parse_shebang_test.py:45–51  ·  view source on GitHub ↗
(shebang, filename='run')

Source from the content-addressed store, hash-verified

43
44
45def write_executable(shebang, filename='run'):
46 os.mkdir('bin')
47 path = os.path.join('bin', filename)
48 with open(path, 'w') as f:
49 f.write(f'#!{shebang}')
50 make_executable(path)
51 return path
52
53
54@contextlib.contextmanager

Calls 1

make_executableFunction · 0.90

Tested by

no test coverage detected