diff --git a/tools/get_version.bat b/tools/get_version.bat index 3d2737d..72f2562 100644 --- a/tools/get_version.bat +++ b/tools/get_version.bat @@ -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 diff --git a/tools/get_version.sh b/tools/get_version.sh index 8d46c64..13ee916 100755 --- a/tools/get_version.sh +++ b/tools/get_version.sh @@ -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" diff --git a/tools/hooks/post-checkout b/tools/hooks/post-checkout new file mode 100644 index 0000000..12285a5 --- /dev/null +++ b/tools/hooks/post-checkout @@ -0,0 +1,2 @@ +#!/bin/bash +./tools/get_version.sh diff --git a/tools/hooks/post-commit b/tools/hooks/post-commit new file mode 100644 index 0000000..12285a5 --- /dev/null +++ b/tools/hooks/post-commit @@ -0,0 +1,2 @@ +#!/bin/bash +./tools/get_version.sh diff --git a/tools/hooks/post-merge b/tools/hooks/post-merge new file mode 100644 index 0000000..12285a5 --- /dev/null +++ b/tools/hooks/post-merge @@ -0,0 +1,2 @@ +#!/bin/bash +./tools/get_version.sh diff --git a/tools/hooks/post-rewrite b/tools/hooks/post-rewrite new file mode 100644 index 0000000..12285a5 --- /dev/null +++ b/tools/hooks/post-rewrite @@ -0,0 +1,2 @@ +#!/bin/bash +./tools/get_version.sh