-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (30 loc) · 955 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
include .env
# ruw q:
# @go mod tidy
# @echo "go mod vendor..."
# @go mod vendor
# @echo "Running my application..."
# @air
migrate:
@echo ${postgres}
@GOOSE_DRIVER=postgres GOOSE_DBSTRING=$(postgres) goose -dir=migrations up
down:
@GOOSE_DRIVER=postgres GOOSE_DBSTRING=$(postgres) goose -dir=migrations down
watch:
@if command -v air > /dev/null; then \
swag init -g cmd/main.go; \
air; \
echo "Watching...";\
else \
read -p "Go's 'air' is not installed on your machine. Do you want to install it? [Y/n] " choice; \
if [ "$$choice" != "n" ] && [ "$$choice" != "N" ]; then \
go install github.com/air-verse/air@latest; \
air; \
echo "Watching...";\
else \
echo "You chose not to install air. Exiting..."; \
exit 1; \
fi; \
fi
swag:
@swag init -g cmd/main.go