Skip to content

Commit

Permalink
Project scaffold.
Browse files Browse the repository at this point in the history
  • Loading branch information
otaviof authored and qu1queee committed Dec 29, 2020
1 parent 2d7dc75 commit f71059e
Show file tree
Hide file tree
Showing 4 changed files with 334 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_output/
42 changes: 42 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
APP = shp
OUTPUT_DIR ?= _output

CMD = ./cmd/$(APP)/...
PKG = ./pkg/...

BIN ?= $(OUTPUT_DIR)/$(APP)

GO_FLAGS ?= -v -mod=vendor
GO_TEST_FLAGS ?= -race -cover

ARGS ?=

default: $(BIN)

.PHONY: $(BIN)
$(BIN):
go build $(GO_FLAGS) -o $(BIN) $(CMD)

# Creates the application binary under output directory.
#
# make build
build: $(BIN)

# Executes the application main binary from source-code with "go run". It takes "ARGS" as the
# command-line direct arguments.
#
# make run ARGS='--help'
run:
go run $(GO_FLAGS) $(CMD) $(ARGS)

# Single target to run all tests.
#
# make test
test: test-unit

# Execute unit-tests.
#
# make test-unit
.PHONY: test-unit
test-unit:
go test $(GO_FLAGS) $(GO_TEST_FLAGS) $(CMD) $(PKG) $(ARGS)
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/shipwright-io/cli

go 1.15

require github.com/spf13/cobra v1.1.1
Loading

0 comments on commit f71059e

Please sign in to comment.