From 03b59c31c6e31cc33532c436d398b9c8c2805d89 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Sat, 11 Sep 2021 12:39:41 +0200 Subject: [PATCH] MacOS Bugfix --- scripts/core/setup-variables.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/core/setup-variables.sh b/scripts/core/setup-variables.sh index d916198..7befa69 100755 --- a/scripts/core/setup-variables.sh +++ b/scripts/core/setup-variables.sh @@ -1,8 +1,16 @@ #!/bin/bash -e +safe_realpath() { + if [[ "$OPERATING_SYSTEM_NAME" == "osx" ]]; then + return "$(grealpath "$1")" + else + return "$(realpath "$1")" + fi +} + echo "====== Setup variables ======" echo "Current root directory:" -realpath . || grealpath . +safe_realpath "." echo "=============================" # ====== CPU Architecture Variables @@ -70,7 +78,7 @@ if [[ "$OPERATING_SYSTEM_NAME" == "linux" ]]; then export CROSS_CC="${CPU_ARCH_CMAKE}-linux-gnu-gcc" export CROSS_CXX="${CPU_ARCH_CMAKE}-linux-gnu-g++" - CROSS_BUILD_DEPS_DIR="$(realpath ../../ || grealpath ../../)/.cache/tdlib-build-cross-${CPU_ARCH_DPKG}/" + CROSS_BUILD_DEPS_DIR="$(safe_realpath "../../")/.cache/tdlib-build-cross-${CPU_ARCH_DPKG}/" fi # ====== Print variables