Skip to content

Commit

Permalink
Move tools to contrib (cosmos#4073)
Browse files Browse the repository at this point in the history
Also rename sdkch to clog
  • Loading branch information
alessio authored Apr 9, 2019
1 parent ae29999 commit 1505c2b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions scripts/Makefile → contrib/devtools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -57,13 +57,13 @@ $(GOBIN)/goimports:
go get golang.org/x/tools/cmd/[email protected]

$(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
File renamed without changes.
12 changes: 5 additions & 7 deletions cmd/sdkch/main.go → contrib/devtools/clog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
--- ---
Expand Down Expand Up @@ -143,8 +142,7 @@ func main() {
}

if err := RootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
log.Fatal(err)
}
}

Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit 1505c2b

Please sign in to comment.