-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathMakefile
41 lines (31 loc) · 926 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
38
39
40
41
.PHONY: all start stop backend frontend
# File to store process IDs
PID_FILE=processes.pid
# Start both backend and frontend
start: start-backend start-frontend
start-backend:
cd backend && go run ./main.go & echo $$! >> $(PID_FILE)
start-frontend:
npm install
npm install [email protected]
npm run dev & echo $$! >> $(PID_FILE)
# Stop all processes
stop:
@if [ -f $(PID_FILE) ]; then \
echo "Stopping processes..."; \
xargs kill < $(PID_FILE) && rm -f $(PID_FILE); \
echo "Processes stopped."; \
else \
echo "No processes to stop."; \
fi
# Combined target to run backend and frontend
all: start
.PHONY: lint check-lint fix-lint
# Run lint checks without fixing
check-lint:
cd backend && golangci-lint run --config .golangci.yaml
# Run lint and automatically fix issues
fix-lint:
cd backend && golangci-lint run --fix --config .golangci.yaml
# Run both check and fix in sequence
lint: check-lint fix-lint