From fba5551bb3e0b5a2b7f914e3e4e1ee6c75a2155e Mon Sep 17 00:00:00 2001 From: Dan Jones Date: Wed, 9 Oct 2024 15:14:37 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Fix=20make=20open-report=20for?= =?UTF-8?q?=20Darwin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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