Skip to content

Commit dc204ad

Browse files
committed
Add version numbers to build
1 parent 7a1659a commit dc204ad

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

internal/consts.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package internal
2+
3+
const (
4+
VERSION = "1.0.0"
5+
)

main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"context"
55
"flag"
6+
"github.com/zlepper/gpm/internal"
67
"log"
78
"os"
89
"os/signal"
@@ -14,6 +15,7 @@ func main() {
1415

1516
flag.Parse()
1617

18+
log.Printf("GPM version %s\n", internal.VERSION)
1719
pm := NewProcessManager()
1820
err = pm.ParseConfigFile(*configPath)
1921
if err != nil {

scripts/build.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"fmt"
5+
"github.com/zlepper/gpm/internal"
56
"log"
67
"os"
78
"os/exec"
@@ -67,7 +68,7 @@ func main() {
6768
goBinary,
6869
"build",
6970
"-o",
70-
fmt.Sprintf("build/gpm-%s", conf.Extension),
71+
fmt.Sprintf("build/gpm-%s-%s", internal.VERSION, conf.Extension),
7172
"github.com/zlepper/gpm",
7273
},
7374
Env: append(

0 commit comments

Comments
 (0)