diff --git a/Makefile b/Makefile index c65ce26..a3d8581 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,12 @@ OUT=my-log GOBIN=$(shell go env GOBIN) COVEROUT=cover.out COVERHTML=cover.html +OPEN=xdg-open +OS=$(shell uname -s) + +ifeq ($(OS),Darwin) +OPEN=open +endif .PHONY: help help: ## Show help for documented recipes @@ -35,7 +41,7 @@ report: $(COVERHTML) ## Generate a coverage report .PHONY: open-report open-report: $(COVERHTML) ## Open the coverage report in the default browser - xdg-open $(COVERHTML) + $(OPEN) $< .PHONY: build build: $(OUT) ## Builds the application