27
Content-Disposition: inline; filename="
e
gen-version.sh
HTTP/1.1 200 OK
Connection: close
Content-Length: 392
Content-Security-Policy: default-src 'none'
Content-Type: text/plain; charset=UTF-8
Date: Mon, 18 Aug 2025 22:39:28 GMT
ETag: "3a080157cf4e871d8e4f63d01855d8eeaf36f943"
Expires: Thu, 16 Aug 2035 22:39:28 GMT
Last-Modified: Mon, 18 Aug 2025 22:39:28 GMT
Server: OpenBSD httpd
X-Content-Type-Options: nosniff

#!/bin/sh

# Get version-info specified in Makefile
V=$1

# Use `git describe` to get current version if we're inside a git repo
if test -d .git
then
	V=$(git describe --abbrev=4 HEAD 2>/dev/null)
fi

new="CGIT_VERSION = $V"
old=$(cat VERSION 2>/dev/null)

# Exit if VERSION is uptodate
test "$old" = "$new" && exit 0

# Update VERSION with new version-info
echo "$new" > VERSION
cat VERSION
