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

Commit 6ae0b3f

Browse files
committed
Fix package generation script
1 parent 3170b57 commit 6ae0b3f

File tree

1 file changed

+76
-27
lines changed

1 file changed

+76
-27
lines changed

Diff for: generate-package.sh

+76-27
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,91 @@
11
#!/bin/sh -eu
22
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3-
if [ $# -lt 3 ]; then
4-
echo "Usage: generate-package.sh [git|lfs|ghu] [windows|mac|linux] [version] [path to file] [host url (optional)] [release notes file (optional)] [message file (optional)]"
5-
exit 1
6-
fi
73

84
URL="http://ghfvs-installer.github.com"
9-
if [ $# -ge 5 ]; then
10-
URL=$5
11-
fi
12-
13-
if [ "$1" == "git" ]; then
14-
URL="$URL/unity/git/$2"
15-
fi
16-
if [ "$1" == "lfs" ]; then
17-
URL="$URL/unity/git/$2"
18-
fi
19-
if [ "$1" == "ghu" ]; then
20-
URL="$URL/unity/releases"
21-
fi
22-
5+
GIT=0
6+
LFS=0
7+
GHU=0
8+
FILE=""
9+
VERSION=""
2310
RN=""
2411
MSG=""
25-
if [ $# -ge 6 ]; then
26-
RN="$6"
12+
OS=""
13+
14+
while [[ $# -gt 0 ]]
15+
do
16+
key="$1"
17+
18+
case $key in
19+
-h)
20+
URL="$2"
21+
shift
22+
shift
23+
;;
24+
-p)
25+
FILE="--path $2"
26+
shift
27+
shift
28+
;;
29+
-v)
30+
VERSION="--version $2"
31+
shift
32+
shift
33+
;;
34+
-r)
35+
RN="--rn $2"
36+
shift
37+
shift
38+
;;
39+
-m)
40+
MSG="--msg $2"
41+
shift
42+
shift
43+
;;
44+
-git)
45+
GIT=1
46+
shift # past value
47+
;;
48+
-lfs)
49+
LFS=1
50+
shift # past value
51+
;;
52+
-ghu)
53+
GHU=1
54+
shift # past value
55+
;;
56+
-windows)
57+
OS="windows"
58+
shift # past value
59+
;;
60+
-mac)
61+
OS="mac"
62+
shift # past value
63+
;;
64+
-linux)
65+
OS="linux"
66+
shift # past value
67+
;;
68+
esac
69+
done
70+
71+
if [ x"$GIT" = "x0" -a x"$LFS" = "x0" -a x"$GHU" = "x0" ]; then
72+
echo "Usage: generate-package.sh [-git|-lfs|-ghu] [-windows|-mac|-linux only if -git or -lfs] [-v version] [-p path to file] [-h host url (optional)] [-r release notes file (optional)] [-m message file (optional)]"
73+
exit 1
2774
fi
2875

29-
if [ $# -ge 7 ]; then
30-
MSG="$7"
76+
if [ x"$GHU" = x"1" ]; then
77+
URL="--url $URL/unity/releases"
78+
else
79+
URL="--url $URL/unity/git/$OS"
3180
fi
3281

33-
EXEC="mono "
34-
if [ -e "/c/" ]; then
35-
EXEC=""
82+
EXEC=
83+
if [ ! -e "/c/" ]; then
84+
EXEC=mono
3685
fi
3786

3887
if [ ! -e "build/CommandLine/CommandLine.exe" ]; then
39-
>&2 xbuild /target:CommandLine "$DIR/GitHub.Unity.sln" /verbosity:minimal
88+
>&2 xbuild /target:CommandLine "$DIR/GitHub.Unity.sln" /verbosity:minimal
4089
fi
4190

42-
$EXEC build/CommandLine/CommandLine.exe --gen-package --version "$3" --path "$4" --url "$URL" --rn "$RN" --msg "$MSG"
91+
$EXEC build/CommandLine/CommandLine.exe --gen-package $VERSION $FILE $URL $RN $MSG

0 commit comments

Comments
 (0)