Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 8a04d7f

Browse files
authored
Merge pull request #129 from github-for-unity/fixes/package-sh-on-windows
Fixing package.sh to run correctly on bash in windows
2 parents 301994b + 8a87d8e commit 8a04d7f

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

package.sh

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,29 @@ pushd src
2222
git clean -xdf
2323
popd
2424

25-
if [ -f "$1/Unity.app/Contents/MacOS/Unity" ]; then
26-
Unity="$1/Unity.app/Contents/MacOS/Unity"
27-
elif [ -f $1/Unity ]; then
28-
Unity="$1/Unity"
29-
else
30-
echo "Can't find Unity in $1"
31-
exit 1
32-
fi
33-
3425
OS="Mac"
35-
if [ -e "/c/" ]; then
26+
if [ -e "c:\\" ]; then
3627
OS="Windows"
3728
fi
3829

30+
if [ x"$OS" == x"Windows" ]; then
31+
if [ -f "$1/Editor/Unity.exe" ]; then
32+
Unity="$1/Editor/Unity.exe"
33+
else
34+
echo "Can't find Unity in $1"
35+
exit 1
36+
fi
37+
else
38+
if [ -f "$1/Unity.app/Contents/MacOS/Unity" ]; then
39+
Unity="$1/Unity.app/Contents/MacOS/Unity"
40+
elif [ -f "$1/Unity" ]; then
41+
Unity="$1/Unity"
42+
else
43+
echo "Can't find Unity in $1"
44+
exit 1
45+
fi
46+
fi
47+
3948
if [ x"$OS" == x"Windows" ]; then
4049
common/nuget restore GitHub.Unity.sln
4150
else

0 commit comments

Comments
 (0)