Move tools to contrib (#4073)

Also rename sdkch to clog
This commit is contained in:
Alessio Treglia 2019-04-09 10:41:00 +01:00 committed by GitHub
parent ae2999931b
commit 1505c2b2e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 15 deletions

View File

@ -62,7 +62,7 @@ BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)'
all: tools install lint test
# The below include contains the tools target.
include scripts/Makefile
include contrib/devtools/Makefile
########################################
### CI

View File

@ -44,11 +44,11 @@ mkfile_dir := $(shell cd $(shell dirname $(mkfile_path)); pwd)
all: tools
tools: tools-stamp
tools-stamp: $(GOBIN)/golangci-lint $(GOBIN)/statik $(GOBIN)/goimports $(GOBIN)/gosum $(GOBIN)/sdkch
tools-stamp: $(GOBIN)/golangci-lint $(GOBIN)/statik $(GOBIN)/goimports $(GOBIN)/gosum $(GOBIN)/clog
touch $@
$(GOBIN)/golangci-lint: contrib/install-golangci-lint.sh $(GOBIN)/gosum
bash contrib/install-golangci-lint.sh $(GOBIN) $(GOLANGCI_LINT_VERSION) $(GOLANGCI_LINT_HASHSUM)
$(GOBIN)/golangci-lint: contrib/devtools/install-golangci-lint.sh $(GOBIN)/gosum
bash contrib/devtools/install-golangci-lint.sh $(GOBIN) $(GOLANGCI_LINT_VERSION) $(GOLANGCI_LINT_HASHSUM)
$(GOBIN)/statik:
$(call go_install,rakyll,statik,v0.1.5)
@ -57,13 +57,13 @@ $(GOBIN)/goimports:
go get golang.org/x/tools/cmd/goimports@v0.0.0-20190114222345-bf090417da8b
$(GOBIN)/gosum:
go install -mod=readonly ./cmd/gosum/
go install -mod=readonly ./contrib/devtools/gosum/
$(GOBIN)/sdkch:
go install -mod=readonly ./cmd/sdkch/
$(GOBIN)/clog:
go install -mod=readonly ./contrib/devtools/clog/
tools-clean:
cd $(GOBIN) && rm -f golangci-lint statik goimports gosum sdkch
cd $(GOBIN) && rm -f golangci-lint statik goimports gosum clog
rm -f tools-stamp
.PHONY: all tools tools-clean

View File

@ -49,16 +49,15 @@ var (
// RootCmd represents the base command when called without any subcommands
RootCmd = &cobra.Command{
Use: "sdkch",
Short: "\nMaintain unreleased changelog entries in a modular fashion.",
Use: "clog",
Short: "Maintain unreleased changelog entries in a modular fashion.",
}
// command to add a pending log entry
AddCmd = &cobra.Command{
Use: "add [section] [stanza] [message]",
Short: "Add an entry file.",
Long: `
Add an entry file. If message is empty, start the editor to edit the message.
Long: `Add an entry file. If message is empty, start the editor to edit the message.
Sections Stanzas
--- ---
@ -143,8 +142,7 @@ func main() {
}
if err := RootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
log.Fatal(err)
}
}
@ -381,7 +379,7 @@ func launchUserEditor() (string, error) {
"VISUAL or EDITOR variables is set and pointing to a correct editor")
}
tempfile, err := ioutil.TempFile("", "sdkch_*")
tempfile, err := ioutil.TempFile("", "clog_*")
tempfilename := tempfile.Name()
if err != nil {
return "", err