更换热重载工具为air
This commit is contained in:
		
							
								
								
									
										9
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								Makefile
									
									
									
									
									
								
							@@ -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
 | 
			
		||||
 | 
			
		||||
# 编译项目
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user