Skip to content

Commit 1e1b3fc

Browse files
committed
Fixing github tests on macos.
To use 'grealpath' on macos, 'coreutils' would have to be installed.
1 parent 11af447 commit 1e1b3fc

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

Diff for: Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
SHELL := bash
22
INSTALL ?= install
3+
UNAME := $(shell uname);
4+
REALPATH := $(shell if [ "$(UNAME)" == "Darwin" ]; then echo grealpath; else echo realpath; fi)
35

46
# Make sure we have git:
57
ifeq ($(shell which git),)
@@ -22,7 +24,7 @@ INSTALL_BIN ?= $(PREFIX)/bin
2224
INSTALL_LIB ?= $(PREFIX)/share/$(NAME)
2325
INSTALL_EXT ?= $(INSTALL_LIB)/$(NAME).d
2426
INSTALL_MAN1 ?= $(PREFIX)/share/man/man1
25-
LINK_REL_DIR := $(shell realpath --relative-to=$(INSTALL_BIN) $(INSTALL_LIB))
27+
LINK_REL_DIR := $(shell $(REALPATH) --relative-to=$(INSTALL_BIN) $(INSTALL_LIB))
2628

2729
# Docker variables:
2830
DOCKER_TAG ?= 0.0.6
@@ -49,6 +51,7 @@ help:
4951

5052
.PHONY: test
5153
test:
54+
@echo UNAME: '$(UNAME)'
5255
prove $(prove) $(test)
5356

5457
test-all: test docker-tests

Diff for: lib/git-subrepo

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ set -e
1212
export FILTER_BRANCH_SQUELCH_WARNING=1
1313

1414
# Import Bash+ helper functions:
15-
SUBREPO_EXT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]}")")/git-subrepo.d" # replaced by `make install`
15+
REALPATH=$(if [ "$(uname)" == "Linux" ]; then echo realpath; else echo realpath; fi)
16+
SUBREPO_EXT_DIR="$(dirname "$($REALPATH "${BASH_SOURCE[0]}")")/git-subrepo.d" # replaced by `make install`
1617
source "${SUBREPO_EXT_DIR}/bash+.bash"
1718
bash+:import :std can version-check
1819

Diff for: test/setup

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
set -e
44

5-
export LC_ALL=C.UTF-8
5+
if [ "$(uname)" == "Linux" ]; then
6+
export LC_ALL=C.UTF-8
7+
fi
68

79
# Get the location of this script
810
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

0 commit comments

Comments
 (0)