mirror of
https://git.mills.io/prologic/zs
synced 2024-11-21 21:06:10 +03:00
Add feedback on what port zs serve listening on
This commit is contained in:
parent
fe82501843
commit
ce83f0d226
7
main.go
7
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)
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user