Skip to content

Commit

Permalink
refactor: make minor modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
namit-chandwani committed Jul 21, 2021
1 parent e8617db commit aa08e8f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@
# Dependency directories (remove the comment below to include it)
# vendor/

/host_example
validator_example
charmil
2 changes: 1 addition & 1 deletion starter/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
# Dependency directories (remove the comment below to include it)
# vendor/

/starter
abc
8 changes: 4 additions & 4 deletions starter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BUILDFLAGS := -gcflags "all=-N -l" $(BUILDFLAGS)
endif

# The details of the application:
binary:=starter
binary:=abc

# Enable Go modules:
export GO111MODULE=on
Expand Down Expand Up @@ -44,11 +44,11 @@ generate:
# Build binaries
# NOTE it may be necessary to use CGO_ENABLED=0 for backwards compatibility with centos7 if not using centos7
binary:
go build $(BUILDFLAGS) -ldflags "${GO_LDFLAGS}" -o ${binary} ./cmd/starter
go build $(BUILDFLAGS) -ldflags "${GO_LDFLAGS}" -o ${binary} ./cmd/abc
.PHONY: binary

install:
go install -trimpath $(BUILDFLAGS) -ldflags "${GO_LDFLAGS}" ./cmd/starter
go install -trimpath $(BUILDFLAGS) -ldflags "${GO_LDFLAGS}" ./cmd/abc
.PHONY: install

test/unit: install
Expand All @@ -72,7 +72,7 @@ docs/check: docs/generate
.PHONY: docs/check

docs/generate:
GENERATE_DOCS=true go run ./cmd/starter
GENERATE_DOCS=true go run ./cmd/abc
.PHONY: docs/generate

docs/generate-modular-docs: docs/generate
Expand Down
13 changes: 10 additions & 3 deletions starter/cmd/abc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,19 @@ func abc() *cobra.Command {
func main() {
cmd := abc()

if err := doc.GenMarkdownTree(cmd, "starter/docs/commands"); err != nil {
log.Fatal(err)
if err := doc.GenMarkdownTree(cmd, "./docs/commands"); err != nil {
cmdFactory.Logger.Errorln(cmdFactory.IOStreams.ErrOut, err)
os.Exit(1)
}

// Writes the current config into the local config file
if err := h.Save(); err != nil {
cmdFactory.Logger.Errorln(cmdFactory.IOStreams.ErrOut, err)
os.Exit(1)
}

if err := cmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
cmdFactory.Logger.Errorln(cmdFactory.IOStreams.ErrOut, err)
os.Exit(1)
}
}

0 comments on commit aa08e8f

Please sign in to comment.