From ac9d7d15e1b21aa1077d864c87cb223008fcd4cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samo=20Poga=C4=8Dnik?= Date: Sun, 24 Nov 2024 11:54:56 +0100 Subject: [PATCH] Fixing github tests on macos --- Makefile | 5 ++++- lib/git-subrepo | 3 ++- test/setup | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index cee2f456..e2be1575 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ SHELL := bash INSTALL ?= install +UNAME := $(shell uname); +REALPATH := $(shell if [ "$(UNAME)" == "Darwin" ]; then echo grealpath; else echo realpath; fi) # Make sure we have git: ifeq ($(shell which git),) @@ -22,7 +24,7 @@ INSTALL_BIN ?= $(PREFIX)/bin INSTALL_LIB ?= $(PREFIX)/share/$(NAME) INSTALL_EXT ?= $(INSTALL_LIB)/$(NAME).d INSTALL_MAN1 ?= $(PREFIX)/share/man/man1 -LINK_REL_DIR := $(shell realpath --relative-to=$(INSTALL_BIN) $(INSTALL_LIB)) +LINK_REL_DIR := $(shell $(REALPATH) --relative-to=$(INSTALL_BIN) $(INSTALL_LIB)) # Docker variables: DOCKER_TAG ?= 0.0.6 @@ -49,6 +51,7 @@ help: .PHONY: test test: + @echo UNAME: '$(UNAME)' prove $(prove) $(test) test-all: test docker-tests diff --git a/lib/git-subrepo b/lib/git-subrepo index aeb37084..de4444c7 100755 --- a/lib/git-subrepo +++ b/lib/git-subrepo @@ -12,7 +12,8 @@ set -e export FILTER_BRANCH_SQUELCH_WARNING=1 # Import Bash+ helper functions: -SUBREPO_EXT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]}")")/git-subrepo.d" # replaced by `make install` +REALPATH=$(if [ "$(uname)" == "Linux" ]; then echo realpath; else echo grealpath; fi) +SUBREPO_EXT_DIR="$(dirname "$($REALPATH "${BASH_SOURCE[0]}")")/git-subrepo.d" # replaced by `make install` source "${SUBREPO_EXT_DIR}/bash+.bash" bash+:import :std can version-check diff --git a/test/setup b/test/setup index ecc2e4ab..79b1483f 100644 --- a/test/setup +++ b/test/setup @@ -2,7 +2,9 @@ set -e -export LC_ALL=C.UTF-8 +if [ "$(uname)" == "Linux" ]; then + export LC_ALL=C.UTF-8 +fi # Get the location of this script SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )