Skip to content

Commit

Permalink
Versioning should still work if this package is a git submodule
Browse files Browse the repository at this point in the history
See discussion in #114 for more details.
  • Loading branch information
arahlin committed Feb 20, 2024
1 parent cc46e8d commit 7c6cbe7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmake/getvers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e
cd $1

# PEP440-compliant version number for pyproject.toml
if [ -d .git ]; then
if [ -e .git ]; then
# replaces first - with .dev and second - with +, so e.g. 0.3-154-gd36baf4a becomes 0.3.dev154+gd36baf4a
fullversion_pep440=$(echo $(git describe --always --tags 2>/dev/null) | sed 's/-/.dev/' | sed 's/-/+/')
fi
Expand Down Expand Up @@ -108,7 +108,7 @@ if [ -d .svn ]; then
echo fullversion=\"$(echo $revision)\"
fi
fi
elif [ -d .git ]; then
elif [ -e .git ]; then
if (git rev-parse --abbrev-ref --symbolic-full-name @{u}>/dev/null 2>/dev/null); then
remote_branch=$(git rev-parse --abbrev-ref --symbolic-full-name @{u})
if (git remote get-url 1>&2 2>/dev/null); then
Expand Down

0 comments on commit 7c6cbe7

Please sign in to comment.