/
davydov
/
NGPowers
Обзор
Документация
Войти
/
davydov
/
NGPowers
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
scripts/setup_hooks.py
37 строк
1 KB
Roman Davydov
feat(ngpowers): synthesize the ultimate autonomous developer ecosystem
09 авг 2026, 12:39
09 авг 2026, 12:39
78901b8
Код
Авторство
О чём код?
#!/usr/bin/env python3 import os import sys import importlib.util # Add project root and scripts directory to sys.path script_dir = os.path.dirname(os.path.abspath(__file__)) project_root = os.path.abspath(os.path.join(script_dir, "..")) if script_dir not in sys.path: sys.path.insert(0, script_dir) # Path to canonical setup_hooks implementation in ngpowers-bootstrap skill skill_hooks_script = os.path.join(project_root, "skills", "ngpowers-bootstrap", "scripts", "setup_hooks.py") if os.path.exists(skill_hooks_script): spec = importlib.util.spec_from_file_location("setup_hooks_skill", skill_hooks_script) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) install_git_hook = module.install_git_hook install_hooks_in_dir = getattr(module, "install_hooks_in_dir", None) main = getattr(module, "main", None) else: def install_git_hook(git_dir): print(f"Error: Skill hooks script not found at {skill_hooks_script}", file=sys.stderr) return False def main(): print(f"Error: Skill hooks script not found at {skill_hooks_script}", file=sys.stderr) sys.exit(1) if __name__ == "__main__": if callable(main): main() else: print("Error: main function not found in target hook script.", file=sys.stderr) sys.exit(1)