Files
uarep-ctl/git-hook.sh

18 lines
803 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# 1. В папке ./git/hooks создать файлы:
# - post-checkout
# - post-commit
# - post-merge
# 2. В каждый файл записать строку:
# ./git-hook.sh
# 3. Теперь модуль scripts/commit.gd будет содержать данные о текущей версии
# Этот скрипт генерирует модуль с информацией о контроле версий
GDSCRIPT_FILE="scripts/commit.gd"
HEAD="$(git rev-parse --abbrev-ref HEAD) $(git rev-parse --short HEAD) $(git log -1 --format=%cd)"
echo "extends Node" > ${GDSCRIPT_FILE}
echo "# Файл сгенерирован автоматически! Не изменять вручную!" >> ${GDSCRIPT_FILE}
echo "const VCS_HEAD = '${HEAD}'" >> ${GDSCRIPT_FILE}