From 6381b7ee3f6a4cbee65d490fae464915e722aebd Mon Sep 17 00:00:00 2001 From: "W. Felix Handte" Date: Mon, 4 May 2020 18:59:47 -0400 Subject: [PATCH] Add Fallback When realpath Doesn't Support --relative-to --- contrib/single_file_libs/combine.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/single_file_libs/combine.sh b/contrib/single_file_libs/combine.sh index a98eef283..40f420256 100755 --- a/contrib/single_file_libs/combine.sh +++ b/contrib/single_file_libs/combine.sh @@ -72,7 +72,11 @@ resolve_include() { local inc=$2 for root in $srcdir $ROOTS; do if [ -f "$root/$inc" ]; then - echo "$(realpath --relative-to . "$root/$inc")" + local relpath="$(realpath --relative-to . "$root/$inc")" + if [ "$?" -eq "0" ]; then # not all realpaths support --relative-to + relpath="$(realpath "$root/$inc")" + fi + echo "$relpath" return 0 fi done -- 2.47.2