scripts: process git versions when lbmk is a worktree or submodule
git worktrees have plaintext .git files which contain the gitdir in their content.
This commit is contained in:
parent
fd41399961
commit
acc57bda6d
|
@ -24,7 +24,7 @@ if [ -f version ]; then
|
||||||
version="$(cat version)"
|
version="$(cat version)"
|
||||||
fi
|
fi
|
||||||
version_="${version}"
|
version_="${version}"
|
||||||
if [ -d ".git/" ]; then
|
if [ -e ".git" ]; then
|
||||||
version="$(git describe --tags HEAD 2>&1)" \
|
version="$(git describe --tags HEAD 2>&1)" \
|
||||||
|| version="git-$(git rev-parse HEAD 2>&1)" \
|
|| version="git-$(git rev-parse HEAD 2>&1)" \
|
||||||
|| version="${version_}"
|
|| version="${version_}"
|
||||||
|
@ -36,7 +36,7 @@ if [ -f versiondate ]; then
|
||||||
versiondate="$(cat versiondate)"
|
versiondate="$(cat versiondate)"
|
||||||
fi
|
fi
|
||||||
versiondate_="${versiondate}"
|
versiondate_="${versiondate}"
|
||||||
if [ -d ".git/" ]; then
|
if [ -e ".git" ]; then
|
||||||
versiondate="$(git show --no-patch --no-notes --pretty='%ct' HEAD)" \
|
versiondate="$(git show --no-patch --no-notes --pretty='%ct' HEAD)" \
|
||||||
|| versiondate="${versiondate_}"
|
|| versiondate="${versiondate_}"
|
||||||
printf "%s\n" "${versiondate}" > versiondate
|
printf "%s\n" "${versiondate}" > versiondate
|
||||||
|
|
Loading…
Reference in New Issue