From cf7e2f3906f78dcb89f320a642428b54c00e4e0b Mon Sep 17 00:00:00 2001 From: Billy O'Neal Date: Tue, 11 Dec 2018 11:48:41 -0800 Subject: Allow redirection of the downloads folder with an environment variable. (#4883) * Add detection for VCPKG_DOWNLOADS environment variable in vcpkgpaths.cpp. * Pass the downloads directory from VcpkgPaths to cmake. * Also fixup bootstrap on *nix. * Make error message a little prettier. * Make that bash script actually work :) * [vcpkg] Alter Optional<> usage style * [vcpkg-docs] Add section on Environment Variables to the docs --- scripts/bootstrap.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'scripts/bootstrap.sh') diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index a8b3d102b..5de0998c1 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -17,7 +17,16 @@ while [ "$vcpkgRootDir" != "/" ] && ! [ -e "$vcpkgRootDir/.vcpkg-root" ]; do vcpkgRootDir="$(dirname "$vcpkgRootDir")" done -downloadsDir="$vcpkgRootDir/downloads" +if [ -z ${VCPKG_DOWNLOADS+x} ]; then + downloadsDir="$vcpkgRootDir/downloads" +else + downloadsDir="$VCPKG_DOWNLOADS" + if [ ! -d "$VCPKG_DOWNLOADS" ]; then + echo "VCPKG_DOWNLOADS was set to '$VCPKG_DOWNLOADS', but that was not a directory." + exit 1 + fi + +fi extractStringBetweenDelimiters() { -- cgit v1.2.3