File: update-version

package info (click to toggle)
mergerfs 2.40.2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,000 kB
  • sloc: cpp: 58,559; ansic: 17,241; makefile: 348; python: 156; sh: 119
file content (18 lines) | stat: -rwxr-xr-x 398 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

VERSION=$(git describe --always --tags --dirty)
if [ $? -ne 0 ]; then
    VERSION=$(cat VERSION)
fi

if [ "${VERSION}" = "" ]; then
    VERSION="unknown"
fi

echo -n "${VERSION}" > VERSION
grep -q \"${VERSION}\" src/version.hpp
RV=$?
if [ $RV -ne 0 ]; then
    echo "#pragma once" > src/version.hpp
    echo "static const char MERGERFS_VERSION[] = \"${VERSION}\";" >> src/version.hpp
fi