Add git hooks to tools

- Place these in your .git/hooks/ directory
This commit is contained in:
LoveEevee 2020-03-17 06:13:36 +03:00
parent 816833bac0
commit 96b1ba4b04
6 changed files with 12 additions and 2 deletions

View File

@ -1,4 +1,4 @@
@echo off
(
git log -1 --pretty="format:{\"commit\": \"%%H\", \"commit_short\": \"%%h\", \"version\": \"%%ad\", \"url\": \"https://github.com/bui/taiko-web/\"}" --date="format:%%y.%%m.%%d"
git log -1 --pretty="format:{\"commit\": \"%%H\", \"commit_short\": \"%%h\", \"version\": \"%%ad\"}" --date="format:%%y.%%m.%%d"
) > ../version.json

View File

@ -1 +1,3 @@
git log -1 --pretty="format:{\"commit\": \"%H\", \"commit_short\": \"%h\", \"version\": \"%ad\", \"url\": \"https://github.com/bui/taiko-web/\"}" --date="format:%y.%m.%d" > ../version.json
#!/bin/bash
toplevel=$( git rev-parse --show-toplevel )
git log -1 --pretty="format:{\"commit\": \"%H\", \"commit_short\": \"%h\", \"version\": \"%ad\"}" --date="format:%y.%m.%d" > "$toplevel/version.json"

View File

@ -0,0 +1,2 @@
#!/bin/bash
./tools/get_version.sh

2
tools/hooks/post-commit Normal file
View File

@ -0,0 +1,2 @@
#!/bin/bash
./tools/get_version.sh

2
tools/hooks/post-merge Normal file
View File

@ -0,0 +1,2 @@
#!/bin/bash
./tools/get_version.sh

2
tools/hooks/post-rewrite Normal file
View File

@ -0,0 +1,2 @@
#!/bin/bash
./tools/get_version.sh