From 400bac4bf18ab76a47911438debbd078d358cecd Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Sun, 19 Jan 2025 12:27:14 -0500 Subject: internal: log version number at debug level on start Signed-off-by: Xe Iaso --- Earthfile | 2 +- internal/internal.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Earthfile b/Earthfile index 794f95e..548fdad 100644 --- a/Earthfile +++ b/Earthfile @@ -28,7 +28,7 @@ everything: COPY . . RUN mkdir -p bin - RUN --mount=type=cache,target=/root/.cache GOBIN=$(pwd)/bin go install -ldflags="-X within.website/x.Version=$(git describe --tags)" ./... + RUN --mount=type=cache,target=/root/.cache sh -c 'GOBIN=$(pwd)/bin go install -ldflags="-X within.website/x.Version=$(git describe --tags)" ./...' SAVE ARTIFACT bin diff --git a/internal/internal.go b/internal/internal.go index 671360f..044d365 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -5,11 +5,13 @@ import ( "context" "flag" "fmt" + stdslog "log/slog" "os" "path/filepath" "github.com/posener/complete" "go4.org/legal" + "within.website/x" "within.website/x/flagfolder" "within.website/x/internal/confyg/flagconfyg" "within.website/x/internal/flagenv" @@ -82,6 +84,8 @@ func HandleStartup() { if *manpageGen { manpage.Spew() } + + stdslog.Debug("starting up", "version", x.Version, "program", filepath.Base(os.Args[0])) } func HandleCompletion(args complete.Predictor, subcommands complete.Commands) { -- cgit v1.2.3