aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2025-01-19 12:27:14 -0500
committerXe Iaso <me@xeiaso.net>2025-01-19 12:27:14 -0500
commit400bac4bf18ab76a47911438debbd078d358cecd (patch)
tree6acf4c061dba309a3b189f88114eefbd9a559bb9
parente72ae5296075d3b5a51a2877c2f3f9aab588be03 (diff)
downloadx-400bac4bf18ab76a47911438debbd078d358cecd.tar.xz
x-400bac4bf18ab76a47911438debbd078d358cecd.zip
internal: log version number at debug level on start
Signed-off-by: Xe Iaso <me@xeiaso.net>
-rw-r--r--Earthfile2
-rw-r--r--internal/internal.go4
2 files changed, 5 insertions, 1 deletions
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) {