diff --git a/Makefile b/Makefile index e539499dad..c0fab2f6bb 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/scripts/Makefile b/contrib/devtools/Makefile similarity index 80% rename from scripts/Makefile rename to contrib/devtools/Makefile index d76720d408..e6f3ccc6b4 100644 --- a/scripts/Makefile +++ b/contrib/devtools/Makefile @@ -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 diff --git a/cmd/sdkch/README.md b/contrib/devtools/clog/README.md similarity index 100% rename from cmd/sdkch/README.md rename to contrib/devtools/clog/README.md diff --git a/cmd/sdkch/main.go b/contrib/devtools/clog/main.go similarity index 97% rename from cmd/sdkch/main.go rename to contrib/devtools/clog/main.go index ad60e6ceda..49107d1cd3 100644 --- a/cmd/sdkch/main.go +++ b/contrib/devtools/clog/main.go @@ -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 diff --git a/cmd/gosum/main.go b/contrib/devtools/gosum/main.go similarity index 100% rename from cmd/gosum/main.go rename to contrib/devtools/gosum/main.go diff --git a/contrib/install-golangci-lint.sh b/contrib/devtools/install-golangci-lint.sh similarity index 100% rename from contrib/install-golangci-lint.sh rename to contrib/devtools/install-golangci-lint.sh