Browse Source

fix --version when ran outside a repo

When git-latexdiff is installed without doing a git clone (e.g.
download a tarball without the .git/ dir), we can't reliably compute a
version. Display 'Unknown version' in this case.
master
Matthieu Moy 11 years ago
parent
commit
292602b237
  1. 2
      git-latexdiff

2
git-latexdiff

@ -45,7 +45,7 @@ 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)
(cd "$(dirname "$0")" && git describe --tags HEAD 2>/dev/null || echo 'Unknown version')
else
echo "$git_latexdiff_version"
fi

Loading…
Cancel
Save