Add go generate script for calculating version number

This commit is contained in:
Elara 2022-11-17 21:27:36 -08:00
parent 6dd1faafac
commit 16adc3d4c7
4 changed files with 12 additions and 3 deletions

View File

@ -1,5 +1,6 @@
before: before:
hooks: hooks:
- go generate
- go mod tidy - go mod tidy
builds: builds:
- id: itd - id: itd

View File

@ -39,9 +39,6 @@ import (
var k = koanf.New(".") var k = koanf.New(".")
//go:embed version.txt
var version string
var ( var (
firmwareUpdating = false firmwareUpdating = false
// The FS must be updated when the watch is reconnected // The FS must be updated when the watch is reconnected

3
scripts/gen-version.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
git describe --tags > version.txt

8
version.go Normal file
View File

@ -0,0 +1,8 @@
package main
import _ "embed"
//go:generate scripts/gen-version.sh
//go:embed version.txt
var version string