-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create Makefile * Create Makefile * Create Makefile
- Loading branch information
1 parent
b17a380
commit 70cfe2a
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
APP_NAME="canasta" | ||
|
||
build: | ||
@go build -o ${APP_NAME} ./. | ||
@go mod tidy | ||
@go mod verify | ||
@echo "To run the CLI you have just generated, please call it as \033[0;32m./${APP_NAME}\033[0m instead of ${APP_NAME}." | ||
|
||
prepare-lint: | ||
@if ! hash golangci-lint 2>/dev/null; then printf "\e[1;36m>> Installing golangci-lint (this may take a while)...\e[0m\n"; go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest; fi | ||
|
||
lint: | ||
@printf "\e[1;36m>> golangci-lint\e[0m\n" | ||
@golangci-lint run ./... | ||
|
||
help: | ||
@printf "\n" | ||
@printf "\e[1mUsage:\e[0m\n" | ||
@printf " make \e[36m<target>\e[0m\n" | ||
@printf "\n" | ||
@printf "\e[1mGeneral\e[0m\n" | ||
@printf " \e[36mhelp\e[0m Display this help.\n" | ||
@printf "\n" | ||
@printf "\e[1mBuild\e[0m\n" | ||
@printf " \e[36mbuild\e[0m Build binary.\n" | ||
@printf "\n" | ||
@printf "\e[1mTest\e[0m\n" | ||
@printf " \e[36mprepare-lint\e[0m Install golangci-lint. This is used in CI, you should probably install golangci-lint using your package manager.\n" | ||
@printf " \e[36mlint\e[0m Run lint.\n" | ||
@printf "\n" | ||
|
||
.PHONY: build prepare-lint lint help |