Skip to content

Commit

Permalink
scripts: don't overwrite generated version if we're not in a git repo
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Feb 5, 2025
1 parent 64591c8 commit 8a6778f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts/generateVersion.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/sh

# if the git directory doesn't exist, don't gather data to avoid overwriting, unless
# the version file is missing altogether (otherwise compiling will fail)
if [[ ! -d ./.git ]]; then
if [[ -f ./src/version.h ]]; then
exit 0
fi
fi

cp -fr ./src/version.h.in ./src/version.h

HASH=${HASH-$(git rev-parse HEAD)}
Expand Down

0 comments on commit 8a6778f

Please sign in to comment.