Add go generate script for calculating version number
This commit is contained in:
parent
6dd1faafac
commit
16adc3d4c7
@ -1,5 +1,6 @@
|
|||||||
before:
|
before:
|
||||||
hooks:
|
hooks:
|
||||||
|
- go generate
|
||||||
- go mod tidy
|
- go mod tidy
|
||||||
builds:
|
builds:
|
||||||
- id: itd
|
- id: itd
|
||||||
|
3
main.go
3
main.go
@ -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
3
scripts/gen-version.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
git describe --tags > version.txt
|
8
version.go
Normal file
8
version.go
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import _ "embed"
|
||||||
|
|
||||||
|
//go:generate scripts/gen-version.sh
|
||||||
|
|
||||||
|
//go:embed version.txt
|
||||||
|
var version string
|
Loading…
Reference in New Issue
Block a user