/
zhendosina
/
obshell
Обзор
Документация
Войти
/
zhendosina
/
obshell
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
git-hooks/init.sh
16 строк
493 B
frf12
PullRequest: 127 feat: add git hooks for swag-fmt
16 май 2024, 14:30
16 май 2024, 14:30
772019d
Код
Авторство
О чём код?
#!/bin/bash # Get the current script's directory SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Get the .git/hooks directory HOOKS_DIR="$(git rev-parse --show-toplevel)/.git/hooks" # Loop through all files in the git-hooks directory for file in "$SCRIPT_DIR"/*; do # Exclude the current file if [[ "$file" != "$SCRIPT_DIR/init.sh" ]]; then # Create a symbolic link in the .git/hooks directory ln -s "$file" "$HOOKS_DIR/$(basename "$file")" fi done