Skip to content

Commit

Permalink
Create Makefile (#100)
Browse files Browse the repository at this point in the history
* Create Makefile

* Create Makefile

* Create Makefile
  • Loading branch information
naresh-kumar-babu authored Feb 12, 2024
1 parent b17a380 commit 70cfe2a
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Makefile
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

0 comments on commit 70cfe2a

Please sign in to comment.