diff options
| author | Miro Knejp <miro.knejp@gmail.com> | 2019-04-20 02:24:05 +0200 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2019-04-19 17:24:05 -0700 |
| commit | 7e8d7b381d4282cfb4c998f93dd03666a68e7fd1 (patch) | |
| tree | 0e6f3054605f5e0b77111adfc4068eb9cd4d6fe8 /scripts | |
| parent | 68759e0dfefe24c9d153c1a1eb794c8b340eb431 (diff) | |
| download | vcpkg-7e8d7b381d4282cfb4c998f93dd03666a68e7fd1.tar.gz vcpkg-7e8d7b381d4282cfb4c998f93dd03666a68e7fd1.zip | |
Run bootstrap-vcpkg.bat when bootstrapped from git-bash (#6142)
* Bootstrap for windows when called from within bash for windows
When calling `bootstrap-vcpkg.sh` from within a git-bash script it fails
with the error message `Unknown uname: MINGW64_NT-10.0`.
This change delegates bootstrapping to `bootstrap-vcpkg.bat` by
executing it in a `cmd` session when the result of `uname -s` matches
the pattern `MINGW*_NT*`.
* [vcpkg-bootstrap] Avoid using bash extensions and keep ./bootstrap-vcpkg.sh as a simple forwarder.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/bootstrap.sh | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index f0bfb9839..99d8dab68 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -1,5 +1,20 @@ #!/bin/sh +# Find .vcpkg-root, which indicates the root of this repo +vcpkgRootDir=$(X= cd -- "$(dirname -- "$0")" && pwd -P) +while [ "$vcpkgRootDir" != "/" ] && ! [ -e "$vcpkgRootDir/.vcpkg-root" ]; do + vcpkgRootDir="$(dirname "$vcpkgRootDir")" +done + +# Enable using this entry point on windows from git bash by redirecting to the .bat file. +unixName=$(uname -s | sed 's/MINGW.*_NT.*/MINGW_NT/') +if [ "$unixName" = "MINGW_NT" ]; then + vcpkgRootDir=$(cygpath -aw "$vcpkgRootDir") + cmd "/C $vcpkgRootDir\\bootstrap-vcpkg.bat" || exit 1 + exit 0 +fi + +# Argument parsing vcpkgDisableMetrics="OFF" vcpkgUseSystem=false vcpkgAllowAppleClang=OFF @@ -26,12 +41,6 @@ do fi done -# Find vcpkg-root -vcpkgRootDir=$(X= cd -- "$(dirname -- "$0")" && pwd -P) -while [ "$vcpkgRootDir" != "/" ] && ! [ -e "$vcpkgRootDir/.vcpkg-root" ]; do - vcpkgRootDir="$(dirname "$vcpkgRootDir")" -done - if [ -z ${VCPKG_DOWNLOADS+x} ]; then downloadsDir="$vcpkgRootDir/downloads" else |
