-
Notifications
You must be signed in to change notification settings - Fork 214
/
Copy pathinstall.sh
executable file
·34 lines (25 loc) · 1.08 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! /bin/sh
set -eu
df -h
BASE_URL=https://download.unity3d.com/download_unity
HASH=$1
VERSION=$2
download() {
file=$1
url="$BASE_URL/$HASH/$package"
localFile=`basename "$package"`
if [ ! -f "$localFile" ]; then echo "Downloading $url" && curl -o "$localFile" "$url"; fi
}
install() {
package=$1
download "$package"
echo "Installing "`basename "$package"`
sudo installer -dumplog -package `basename "$package"` -target /
}
# See $BASE_URL/$HASH/unity-$VERSION-$PLATFORM.ini for complete list
# of available packages, where PLATFORM is `osx` or `win`
if [ ! -f "Unity-Mac.pkg" ]; then install "Unity-Mac.pkg"; else install "MacEditorInstaller/Unity-$VERSION.pkg"; fi
wait
if [ ! -f "UnitySetup-Windows-Support-for-Editor.pkg" ]; then install "UnitySetup-Windows-Support-for-Editor.pkg"; else install "MacEditorTargetInstaller/UnitySetup-Windows-Support-for-Editor-$VERSION.pkg"; fi
wait
if [ ! -f "UnitySetup-iOS-Support-for-Editor.pkg" ]; then install "UnitySetup-iOS-Support-for-Editor.pkg"; else install "MacEditorTargetInstaller/UnitySetup-iOS-Support-for-Editor-$VERSION.pkg"; fi