3 source="${BASH_SOURCE[0]}"
5 function is_cygwin_or_mingw()
14 # resolve $SOURCE until the file is no longer a symlink
15 while [[ -h $source ]]; do
16 scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
17 source="$(readlink "$source")"
19 # if $source was a relative symlink, we need to resolve it relative to the path where the
20 # symlink file was located
21 [[ $source != /* ]] && source="$scriptroot/$source"
24 scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
26 if is_cygwin_or_mingw; then
27 # if bash shell running on Windows (not WSL),
28 # pass control to powershell build script.
29 scriptroot=$(cygpath -d "$scriptroot")
30 powershell -c "$scriptroot\\build.cmd" $@
32 "$scriptroot/eng/build.sh" $@