Skip to content

Commit 7783fd5

Browse files
eiriktsarpalisViktorHofer
authored andcommitted
Add windows support for build.sh (#94)
1 parent 912f082 commit 7783fd5

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

build.sh

+18-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
source="${BASH_SOURCE[0]}"
44

5+
function is_cygwin_or_mingw()
6+
{
7+
case $(uname -s) in
8+
CYGWIN*) return 0;;
9+
MINGW*) return 0;;
10+
*) return 1;;
11+
esac
12+
}
13+
514
# resolve $SOURCE until the file is no longer a symlink
615
while [[ -h $source ]]; do
716
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
@@ -13,4 +22,12 @@ while [[ -h $source ]]; do
1322
done
1423

1524
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
16-
"$scriptroot/eng/build.sh" $@
25+
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" $@
31+
else
32+
"$scriptroot/eng/build.sh" $@
33+
fi

0 commit comments

Comments
 (0)