From 76db985cf1c3ca4ff792b82f6209e00ba5679b58 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 15 Nov 2024 13:40:07 -0600 Subject: [PATCH] unstashed --- Makefile | 6 ++++-- argv.go | 2 +- main.go | 7 +++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 24726cb..2ef1093 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,14 @@ 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 # 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) all: - GO111MODULE=off go build -v -x -ldflags "-X main.VERSION=${VERSION} -X gui.GUIVERSION=${VERSION}" - ./zood + GO111MODULE=off go build \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + #./zood ./zood --version # this is for release builds using the go.mod files diff --git a/argv.go b/argv.go index edaa104..9f570e4 100644 --- a/argv.go +++ b/argv.go @@ -16,7 +16,7 @@ type args struct { } func (args) Version() string { - return "zood " + VERSION + return "zood " + VERSION + " Built on: " + BUILDTIME } func init() { diff --git a/main.go b/main.go index 3368042..7734a58 100644 --- a/main.go +++ b/main.go @@ -25,6 +25,7 @@ import ( ) var VERSION string +var BUILDTIME string //go:embed resources/* var resources embed.FS @@ -51,10 +52,13 @@ func main() { return } + log.Info("debian has", len(installedPackages), "installed") + /* // Print the installed packages and their versions for pkg, version := range installedPackages { fmt.Printf("%s: %s\n", pkg, version) } + */ // Detect the Linux distribution distro := detectDistro() @@ -72,6 +76,7 @@ func main() { return } + /* // Print the installed packages fmt.Println("Installed Packages:") for _, pkg := range packages { @@ -79,6 +84,8 @@ func main() { fmt.Println(pkg) } } + */ + log.Info(distro, "has", len(packages), "installed") go NewWatchdog()