更换热重载工具为air

This commit is contained in:
2024-10-26 05:54:32 +08:00
parent 61c2840612
commit 925f1f4b3b
5 changed files with 15 additions and 91 deletions

View File

@@ -1,13 +1,12 @@
# 运行本地开发环境(使用SSH隧道代理端口)
dev:
@if ! go list -m github.com/gravityblast/fresh >/dev/null 2>&1; then \
echo "github.com/gravityblast/fresh is not installed. Installing..."; \
go get github.com/gravityblast/fresh; \
@if ! go list -m github.com/air-verse/air@latest >/dev/null 2>&1; then \
echo "github.com/air-verse/air@latest is not installed. Installing..."; \
go get github.com/air-verse/air@latest; \
fi;
@ssh -NCPf main -L 3306:localhost:3306 -L 19530:localhost:19530 & \
sleep 1; \
echo "Starting Go application..."; \
go run github.com/gravityblast/fresh; \
go run github.com/air-verse/air@latest --build.cmd "go build -o ./data/ bin/main.go" --build.bin "./data/main"; \
wait
# 编译项目