Add the ./go shell script

pull/6/head
Mickaël Menu 3 years ago
parent f2025b3a60
commit c89ff1e58a
No known key found for this signature in database
GPG Key ID: 53D73664CD359895

6
go

@ -0,0 +1,6 @@
#!/bin/sh
VERSION=`git describe --tags 2> /dev/null`
BUILD=`git rev-parse --short HEAD`
go $1 -tags "fts5 icu" -ldflags "-X=main.Version=$VERSION -X=main.Build=$BUILD" ${@:2}

@ -5,16 +5,25 @@ import (
"github.com/mickael-menu/zk/cmd"
)
var Version = "dev"
var Build = "dev"
var cli struct {
Init cmd.Init `cmd help:"Create a slip box in the given directory"`
New cmd.New `cmd help:"Add a new note to the slip box"`
Init cmd.Init `cmd help:"Create a slip box in the given directory"`
New cmd.New `cmd help:"Add a new note to the slip box"`
Version kong.VersionFlag `help:"Print zk version"`
}
func main() {
// Create the dependency graph.
container := cmd.NewContainer()
ctx := kong.Parse(&cli, kong.Name("zk"))
ctx := kong.Parse(&cli,
kong.Name("zk"),
kong.Vars{
"version": Version,
},
)
err := ctx.Run(container)
ctx.FatalIfErrorf(err)
}

Loading…
Cancel
Save