From 6cb9c7cf4136c14b59768c81a4e623b89f5eaeff Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 30 Sep 2020 17:16:28 -0700 Subject: [PATCH] Enable set the VENDORED_PATH for libgit2 (#650) (#652) ### What this change is doing? This change aims to enable us to set the `VENDORED_PATH` as an environment variable and failback to the default value if the environment variable is not set. Thus, this change should not break current behavior. ### Why we need this? This will enable using the script to build libgit2 form source code downloaded manually. Example: ```sh LIBGIT2_VER="1.0.1" DOWNLOAD_URL="https://codeload.github.com/libgit2/libgit2/tar.gz/v${LIBGIT2_VER}"" LIBGIT2_PATH="${HOME}/libgit2-${LIBGIT2_VER}" wget -O "${LIBGIT2_PATH}.tar.gz" "$DOWNLOAD_URL" tar -xzvf "${LIBGIT2_PATH}.tar.gz" VENDORED_PATH=$LIBGIT2_PATH sh ./script/build-libgit2.sh --static ``` (cherry picked from commit f3a746d7b6a27a9d6f98143641466f68ef1f3dee) Co-authored-by: Suhaib Mujahid --- script/build-libgit2.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/build-libgit2.sh b/script/build-libgit2.sh index 3cbfa4e..a541849 100755 --- a/script/build-libgit2.sh +++ b/script/build-libgit2.sh @@ -15,8 +15,8 @@ if [ "$#" -eq "0" ]; then usage fi -ROOT="$(cd "$(dirname "$0")/.." && echo "${PWD}")" -VENDORED_PATH="${ROOT}/vendor/libgit2" +ROOT=${ROOT-"$(cd "$(dirname "$0")/.." && echo "${PWD}")"} +VENDORED_PATH=${VENDORED_PATH-"${ROOT}/vendor/libgit2"} BUILD_SYSTEM=OFF while [ $# -gt 0 ]; do