Files
lab-ca/set-version.sh

8 lines
287 B
Bash
Executable File

#!/bin/bash
VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "dev")
# Allow git to track changes to version.go
git update-index --no-assume-unchanged version.go
# Hardcode the version into main.go
sed -i '' "s/^var Version = .*/var Version = \"$VERSION\"/" version.go