mirror of
https://gitea.com/gitea/gitea-mcp.git
synced 2025-08-23 14:23:05 +00:00
refactor: add hot reloading and improve logging functions
- Add command to install `air` for hot reloading in `Makefile` - Add `dev` command to run the application with hot reload in `Makefile` - Add `vendor` command to tidy and verify module dependencies in `Makefile` - Update log synchronization method to use `log.Default().Sync()` in `cmd/cmd.go` - Change variadic parameter type from `interface{}` to `any` in logging functions - Remove `Sync` function from `pkg/log/log.go` ref: https://github.com/uber-go/zap/issues/880 Signed-off-by: appleboy <appleboy.tw@gmail.com>
This commit is contained in:
21
Makefile
21
Makefile
@@ -3,4 +3,23 @@ EXECUTABLE := gitea-mcp
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
$(GO) build -v -ldflags '-s -w' -o $(EXECUTABLE)
|
||||
$(GO) build -v -ldflags '-s -w' -o $(EXECUTABLE)
|
||||
|
||||
## air: install air for hot reload
|
||||
.PHONY: air
|
||||
air:
|
||||
@hash air > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
$(GO) install github.com/air-verse/air@latest; \
|
||||
fi
|
||||
|
||||
## dev: run the application with hot reload
|
||||
.PHONY: dev
|
||||
dev: air
|
||||
air --build.cmd "make build" --build.bin ./gitea-mcp
|
||||
|
||||
## vendor: tidy and verify module dependencies
|
||||
.PHONY: vendor
|
||||
vendor:
|
||||
@echo 'Tidying and verifying module dependencies...'
|
||||
go mod tidy
|
||||
go mod verify
|
Reference in New Issue
Block a user