Browse Source

Fix version string

The previous version was hardcoded in the script, and not linked to Git
tags. It has been 1.0 since Dec 24 15:35:32 2012, before the 1.0.0 tag
actually.
master
Matthieu Moy 10 years ago
parent
commit
aa4a019a1c
  1. 5
      Makefile
  2. 12
      git-latexdiff

5
Makefile

@ -7,6 +7,7 @@ ifndef SHELL_PATH
endif
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
GIT_LATEXDIFF_VERSION=${shell git describe --tags HEAD}
gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
SCRIPT=git-latexdiff
@ -19,5 +20,7 @@ help:
@echo 'Run "$(MAKE) install" to install $(SCRIPT) in gitexecdir.'
install:
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' $(SCRIPT) > '$(gitexecdir_SQ)/$(SCRIPT)'
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|@GIT_LATEXDIFF_VERSION@|$(GIT_LATEXDIFF_VERSION)|' \
$(SCRIPT) > '$(gitexecdir_SQ)/$(SCRIPT)'
chmod 755 '$(gitexecdir)/$(SCRIPT)'

12
git-latexdiff

@ -41,7 +41,15 @@
set -o errexit
set -o noclobber
git_latexdiff_version=1.0
git_latexdiff_version='@GIT_LATEXDIFF_VERSION@'
git_latexdiff_compute_version () {
if [ "$git_latexdiff_version" = '@GIT_LATEXDIFF_VERSION@' ]; then
(cd "$(dirname "$0")" && git describe --tags HEAD)
else
echo "$git_latexdiff_version"
fi
}
usage () {
cat << EOF
@ -223,7 +231,7 @@ while test $# -ne 0; do
quiet=1
;;
"--version")
echo "$git_latexdiff_version"
git_latexdiff_compute_version
exit 0
;;
"--subtree")

Loading…
Cancel
Save