From ce83f0d2261af73a42df62e35d5cd80f2af4122e Mon Sep 17 00:00:00 2001 From: James Mills Date: Tue, 1 Oct 2024 23:03:25 +1000 Subject: [PATCH] Add feedback on what port zs serve listening on --- main.go | 7 ++++--- version.go | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 6cdc6b5..1ee3fea 100644 --- a/main.go +++ b/main.go @@ -259,7 +259,7 @@ var VarCmd = &cobra.Command{ Short: "Display variables for the specified file", Long: `The var command extracts and display sll teh variables defined in a file. If the name of variables (optional) are passed as additional arguments, only those variables -are display instead of all variables (the default behavior).`, +are display instead of all variables (the default behaviors).`, Args: cobra.MinimumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { s := "" @@ -589,9 +589,8 @@ func build(path string, w io.Writer, vars Vars) error { return buildMarkdown(path, w, vars) } else if ext == ".html" || ext == ".xml" { return buildHTML(path, w, vars) - } else { - return buildRaw(path, w) } + return buildRaw(path, w) } func buildAll(ctx context.Context, watch bool) error { @@ -700,6 +699,8 @@ func serve(ctx context.Context, bind, root string) error { return err } + log.Infof("zs %s server listening on %s", ShortVersion(), bind) + go svr.Run(ctx) go buildAll(ctx, true) diff --git a/version.go b/version.go index c8d3735..333562f 100644 --- a/version.go +++ b/version.go @@ -48,3 +48,8 @@ func FullVersion() string { return sb.String() } + +// ShortVersion display the short version and build +func ShortVersion() string { + return fmt.Sprintf("%s@%s", Version, Commit) +}