~kaction/config

ref: bd83900251b2478f4863aa288b5c68d655e63eba config/universe/githooks/build.py -rw-r--r-- 449 bytes
bd839002 — Dmitry Bogatov Recover git-logp script 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os
import json

for key, value in os.environ.items():
    globals()[key] = value

hooks = json.loads(hooks)

for hook, scripts in hooks.items():
    os.makedirs(f"{out}/{hook}.d")
    for name, path in scripts.items():
        os.symlink(path, f"{out}/{hook}.d/{name}")
    with open(f"{out}/{hook}", "w") as fp:
        fp.write(f"""
#!{execline}/bin/execlineb -WS0
{rundir} {out}/{hook}.d $@
"""[1:])
    os.chmod(f"{out}/{hook}", 0o777)