Refactor Makefile to streamline build and run commands
- Updated the run command to execute the application from a built snapshot instead of using `go run`. - Added a new run-debug command for running the application with debug logging. - Consolidated the build process into a single target snapshot build command. - Enhanced help output to reflect the new command structure.
This commit is contained in:
26
Makefile
26
Makefile
@@ -1,5 +1,16 @@
|
|||||||
run: deps test ## Run the application
|
run: build-snapshot-single ## Run the application
|
||||||
@go run .
|
@dist/default_windows_amd64_v1/steamcache2.exe
|
||||||
|
run-debug: build-snapshot-single ## Run the application with debug logging
|
||||||
|
@dist/default_windows_amd64_v1/steamcache2.exe --log-level debug
|
||||||
|
|
||||||
|
test: deps ## Run all tests
|
||||||
|
@go test -v ./...
|
||||||
|
|
||||||
|
deps: ## Download dependencies
|
||||||
|
@go mod tidy
|
||||||
|
|
||||||
|
build-snapshot-single: deps test ## Build a snapshot of the application for the current platform
|
||||||
|
@goreleaser build --single-target --snapshot --clean
|
||||||
|
|
||||||
help: ## Show this help message
|
help: ## Show this help message
|
||||||
@echo SteamCache2 Makefile
|
@echo SteamCache2 Makefile
|
||||||
@@ -7,13 +18,4 @@ help: ## Show this help message
|
|||||||
@echo run Run the application
|
@echo run Run the application
|
||||||
@echo run-debug Run the application with debug logging
|
@echo run-debug Run the application with debug logging
|
||||||
@echo test Run all tests
|
@echo test Run all tests
|
||||||
@echo deps Download dependencies
|
@echo deps Download dependencies
|
||||||
|
|
||||||
run-debug: deps test ## Run the application with debug logging
|
|
||||||
@go run . --log-level debug
|
|
||||||
|
|
||||||
test: deps ## Run all tests
|
|
||||||
@go test -v ./...
|
|
||||||
|
|
||||||
deps: ## Download dependencies
|
|
||||||
@go mod tidy
|
|
||||||
Reference in New Issue
Block a user