unstashed
This commit is contained in:
parent
ea96d4880e
commit
76db985cf1
6
Makefile
6
Makefile
|
@ -1,12 +1,14 @@
|
||||||
VERSION = $(shell git describe --tags)
|
VERSION = $(shell git describe --tags)
|
||||||
|
BUILDTIME = $(shell date +%Y.%m.%d_%H%M)
|
||||||
|
|
||||||
# create the go.mod and go.sum if this is a brand new repo
|
# create the go.mod and go.sum if this is a brand new repo
|
||||||
# REDOMOD = $(shell if [ -e go.mod ]; then echo go.mod; else echo no go mod; fi)
|
# REDOMOD = $(shell if [ -e go.mod ]; then echo go.mod; else echo no go mod; fi)
|
||||||
REDOMOD = $(shell if [ -e go.sum ]; then echo go.sum exists; else GO111MODULE= go mod init; GO111MODULE= go mod tidy; fi)
|
REDOMOD = $(shell if [ -e go.sum ]; then echo go.sum exists; else GO111MODULE= go mod init; GO111MODULE= go mod tidy; fi)
|
||||||
|
|
||||||
all:
|
all:
|
||||||
GO111MODULE=off go build -v -x -ldflags "-X main.VERSION=${VERSION} -X gui.GUIVERSION=${VERSION}"
|
GO111MODULE=off go build \
|
||||||
./zood
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
||||||
|
#./zood
|
||||||
./zood --version
|
./zood --version
|
||||||
|
|
||||||
# this is for release builds using the go.mod files
|
# this is for release builds using the go.mod files
|
||||||
|
|
2
argv.go
2
argv.go
|
@ -16,7 +16,7 @@ type args struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (args) Version() string {
|
func (args) Version() string {
|
||||||
return "zood " + VERSION
|
return "zood " + VERSION + " Built on: " + BUILDTIME
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
7
main.go
7
main.go
|
@ -25,6 +25,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var VERSION string
|
var VERSION string
|
||||||
|
var BUILDTIME string
|
||||||
|
|
||||||
//go:embed resources/*
|
//go:embed resources/*
|
||||||
var resources embed.FS
|
var resources embed.FS
|
||||||
|
@ -51,10 +52,13 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Info("debian has", len(installedPackages), "installed")
|
||||||
|
/*
|
||||||
// Print the installed packages and their versions
|
// Print the installed packages and their versions
|
||||||
for pkg, version := range installedPackages {
|
for pkg, version := range installedPackages {
|
||||||
fmt.Printf("%s: %s\n", pkg, version)
|
fmt.Printf("%s: %s\n", pkg, version)
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Detect the Linux distribution
|
// Detect the Linux distribution
|
||||||
distro := detectDistro()
|
distro := detectDistro()
|
||||||
|
@ -72,6 +76,7 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
// Print the installed packages
|
// Print the installed packages
|
||||||
fmt.Println("Installed Packages:")
|
fmt.Println("Installed Packages:")
|
||||||
for _, pkg := range packages {
|
for _, pkg := range packages {
|
||||||
|
@ -79,6 +84,8 @@ func main() {
|
||||||
fmt.Println(pkg)
|
fmt.Println(pkg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
log.Info(distro, "has", len(packages), "installed")
|
||||||
|
|
||||||
go NewWatchdog()
|
go NewWatchdog()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue