Skip to content

Commit f3a746d

Browse files
Enable set the VENDORED_PATH for libgit2 (libgit2#650)
### 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 ```
1 parent 3c5c580 commit f3a746d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

script/build-libgit2.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ if [ "$#" -eq "0" ]; then
1515
usage
1616
fi
1717

18-
ROOT="$(cd "$(dirname "$0")/.." && echo "${PWD}")"
19-
VENDORED_PATH="${ROOT}/vendor/libgit2"
18+
ROOT=${ROOT-"$(cd "$(dirname "$0")/.." && echo "${PWD}")"}
19+
VENDORED_PATH=${VENDORED_PATH-"${ROOT}/vendor/libgit2"}
2020
BUILD_SYSTEM=OFF
2121

2222
while [ $# -gt 0 ]; do

0 commit comments

Comments
 (0)