latest, testing with ci now
This commit is contained in:
parent
081028f3b2
commit
ea96e0d786
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
*.pb.go
|
*.pb.go
|
||||||
/cmd/mfer/mfer
|
/mfer
|
||||||
|
27
Makefile
27
Makefile
@ -1,24 +1,31 @@
|
|||||||
PROTOC_GEN_GO := $(GOPATH)/bin/protoc-gen-go
|
PROTOC_GEN_GO := $(shell go env GOPATH)/bin/protoc-gen-go
|
||||||
|
|
||||||
|
ARCH := $(shell uname -m)
|
||||||
|
VERSION := $(shell git describe --always --dirty=-dirty)
|
||||||
|
|
||||||
|
GOLDFLAGS += -X main.Version=$(VERSION)
|
||||||
|
GOLDFLAGS += -X main.Buildarch=$(ARCH)
|
||||||
|
GOFLAGS := -ldflags "$(GOLDFLAGS)"
|
||||||
|
|
||||||
default: run
|
default: run
|
||||||
|
|
||||||
run: compile
|
run: ./mfer
|
||||||
./cmd/mfer/mfer
|
./$<
|
||||||
./cmd/mfer/mfer gen .
|
./$< gen
|
||||||
|
|
||||||
$(PROTOC_GEN_GO):
|
$(PROTOC_GEN_GO):
|
||||||
go get -u github.com/golang/protobuf/protoc-gen-go
|
test -e $(PROTOC_GEN_GO) || go get -u github.com/golang/protobuf/protoc-gen-go
|
||||||
|
|
||||||
prereqs: $(PROTOC_GEN_GO)
|
prereqs: $(PROTOC_GEN_GO)
|
||||||
which gofumpt && go install -v mvdan.cc/gofumpt@latest
|
which gofumpt || go install -v mvdan.cc/gofumpt@latest
|
||||||
which golangci-lint && go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
which golangci-lint || go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||||
|
|
||||||
compile: prereqs
|
mfer: prereqs src/*.go cmd/*/*.go
|
||||||
cd proto && go generate .
|
cd proto && go generate .
|
||||||
cd cmd/mfer && go build
|
cd cmd/mfer && go build -o ../../mfer $(GOFLAGS) .
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rfv proto/*.pb.go
|
rm -rfv proto/*.pb.go ./mfer
|
||||||
|
|
||||||
fmt: prereqs
|
fmt: prereqs
|
||||||
gofumpt -l -w src cmd
|
gofumpt -l -w src cmd
|
||||||
|
@ -10,10 +10,13 @@ import (
|
|||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Run(Appname, Version, Buildarch string) int {
|
func printBanner(Appname, Version, Buildarch string) {
|
||||||
s, _ := pterm.DefaultBigText.WithLetters(pterm.NewLettersFromString(Appname)).Srender()
|
s, _ := pterm.DefaultBigText.WithLetters(pterm.NewLettersFromString(Appname)).Srender()
|
||||||
pterm.DefaultCenter.Println(s) // Print BigLetters with the default CenterPrinter
|
pterm.DefaultCenter.Println(s) // Print BigLetters with the default CenterPrinter
|
||||||
|
}
|
||||||
|
|
||||||
|
func Run(Appname, Version, Buildarch string) int {
|
||||||
|
printBanner(Appname, Version, Buildarch)
|
||||||
app := &cli.App{
|
app := &cli.App{
|
||||||
Name: Appname,
|
Name: Appname,
|
||||||
Usage: "Manifest generator",
|
Usage: "Manifest generator",
|
||||||
|
Loading…
Reference in New Issue
Block a user