diff --git a/ignore-changes-to-version-go.sh b/ignore-changes-to-version-go.sh new file mode 100755 index 0000000..b4dade5 --- /dev/null +++ b/ignore-changes-to-version-go.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +git update-index --assume-unchanged version.go \ No newline at end of file diff --git a/set-version.sh b/set-version.sh new file mode 100755 index 0000000..abc56a9 --- /dev/null +++ b/set-version.sh @@ -0,0 +1,7 @@ +#!/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