@@ -4,47 +4,59 @@ pushd `dirname $0` > /dev/null
44FullScriptPath=` pwd`
55popd > /dev/null
66
7+ if [ ! -d " $FullScriptPath /../../../TelegramPrivate" ]; then
8+ echo " "
9+ echo " This script is for building the production version of Telegram Desktop."
10+ echo " "
11+ echo " For building custom versions please visit the build instructions page at:"
12+ echo " https://github.com/telegramdesktop/tdesktop/#build-instructions"
13+ exit
14+ fi
15+
16+ Error () {
17+ cd $FullExecPath
18+ echo " $1 "
19+ exit 1
20+ }
21+
722DeployTarget=" $1 "
823
24+ if [ ! -f " $FullScriptPath /target" ]; then
25+ Error " Build target not found!"
26+ fi
27+
28+ while IFS=' ' read -r line || [[ -n " $line " ]]; do
29+ BuildTarget=" $line "
30+ done < " $FullScriptPath /target"
31+
932while IFS=' ' read -r line || [[ -n " $line " ]]; do
1033 set $line
1134 eval $1 =" $2 "
12- done < Version
35+ done < " $FullScriptPath /version "
1336
1437if [ " $BetaVersion " != " 0" ]; then
1538 AppVersion=" $BetaVersion "
1639 AppVersionStrFull=" ${AppVersionStr} _${BetaVersion} "
17- DevParam=" -beta $BetaVersion "
1840 BetaKeyFile=" tbeta_${AppVersion} _key"
19- elif [ " $DevChannel " == " 0" ]; then
41+ elif [ " $AlphaChannel " == " 0" ]; then
2042 AppVersionStrFull=" $AppVersionStr "
21- DevParam=' '
2243else
23- AppVersionStrFull=" $AppVersionStr .dev"
24- DevParam=' -dev'
44+ AppVersionStrFull=" $AppVersionStr .alpha"
2545fi
2646
27- if [ ! -f " Target" ]; then
28- echo " Deploy target not found!"
29- exit 1
30- fi
31-
32- while IFS=' ' read -r line || [[ -n " $line " ]]; do
33- BuildTarget=" $line "
34- done < Target
35-
3647echo " "
48+ HomePath=" $FullScriptPath /.."
3749if [ " $BuildTarget " == " linux" ]; then
3850 echo " Deploying version $AppVersionStrFull for Linux 64bit.."
3951 UpdateFile=" tlinuxupd$AppVersion "
4052 SetupFile=" tsetup.$AppVersionStrFull .tar.xz"
41- ReleasePath=" . /../Linux/Release"
53+ ReleasePath=" $HomePath /../Linux/Release"
4254 RemoteFolder=" tlinux"
4355elif [ " $BuildTarget " == " linux32" ]; then
4456 echo " Deploying version $AppVersionStrFull for Linux 32bit.."
4557 UpdateFile=" tlinux32upd$AppVersion "
4658 SetupFile=" tsetup32.$AppVersionStrFull .tar.xz"
47- ReleasePath=" . /../Linux/Release"
59+ ReleasePath=" $HomePath /../Linux/Release"
4860 RemoteFolder=" tlinux32"
4961elif [ " $BuildTarget " == " mac" ]; then
5062 DeployMac=" 0"
@@ -71,27 +83,25 @@ elif [ "$BuildTarget" == "mac" ]; then
7183 fi
7284 UpdateFile=" tmacupd$AppVersion "
7385 SetupFile=" tsetup.$AppVersionStrFull .dmg"
74- ReleasePath=" . /../Mac/Release"
86+ ReleasePath=" $HomePath /../Mac/Release"
7587 RemoteFolder=" tmac"
76- Mac32DeployPath=" . /../../tother/tmac32/$AppVersionStrMajor /$AppVersionStrFull "
88+ Mac32DeployPath=" $HomePath /../../tother/tmac32/$AppVersionStrMajor /$AppVersionStrFull "
7789 Mac32UpdateFile=" tmac32upd$AppVersion "
7890 Mac32SetupFile=" tsetup32.$AppVersionStrFull .dmg"
7991 Mac32RemoteFolder=" tmac32"
80- WinDeployPath=" . /../../tother/tsetup/$AppVersionStrMajor /$AppVersionStrFull "
92+ WinDeployPath=" $HomePath /../../tother/tsetup/$AppVersionStrMajor /$AppVersionStrFull "
8193 WinUpdateFile=" tupdate$AppVersion "
8294 WinSetupFile=" tsetup.$AppVersionStrFull .exe"
8395 WinPortableFile=" tportable.$AppVersionStrFull .zip"
8496 WinRemoteFolder=" tsetup"
85- DropboxPath=" ./../../.. /Dropbox/Telegram/deploy/$AppVersionStrMajor "
97+ DropboxPath=" /Volumes/Storage /Dropbox/Telegram/deploy/$AppVersionStrMajor "
8698 DropboxDeployPath=" $DropboxPath /$AppVersionStrFull "
8799 DropboxSetupFile=" $SetupFile "
88100 DropboxMac32SetupFile=" $Mac32SetupFile "
89101elif [ " $BuildTarget " == " mac32" ] || [ " $BuildTarget " = " macstore" ]; then
90- echo " No need to deploy this target."
91- exit
102+ Error " No need to deploy this target."
92103else
93- echo " Invalid target!"
94- exit 1
104+ Error " Invalid target!"
95105fi
96106
97107DeployPath=" $ReleasePath /deploy/$AppVersionStrMajor /$AppVersionStrFull "
@@ -105,8 +115,7 @@ if [ "$BetaVersion" != "0" ]; then
105115 BetaFilePath=" $DeployPath /$BetaKeyFile "
106116 fi
107117 if [ ! -f " $BetaFilePath " ]; then
108- echo " Beta key file for $AppVersionStrFull not found :("
109- exit 1
118+ Error " Beta key file for $AppVersionStrFull not found :("
110119 fi
111120
112121 while IFS=' ' read -r line || [[ -n " $line " ]]; do
131140
132141 if [ " $BuildTarget " != " mac" ] || [ " $DeployMac " == " 1" ]; then
133142 if [ ! -f " $DeployPath /$UpdateFile " ]; then
134- echo " $UpdateFile not found!" ;
135- exit 1
143+ Error " $UpdateFile not found!" ;
136144 fi
137145
138146 if [ ! -f " $DeployPath /$SetupFile " ]; then
139- echo " $SetupFile not found!"
140- exit 1
147+ Error " $SetupFile not found!"
141148 fi
142149 fi
143150
144151 if [ " $BuildTarget " == " mac" ]; then
145152 if [ " $DeployMac32 " == " 1" ]; then
146153 if [ ! -f " $Mac32DeployPath /$Mac32UpdateFile " ]; then
147- echo " $Mac32UpdateFile not found!"
148- exit 1
154+ Error " $Mac32UpdateFile not found!"
149155 fi
150156
151157 if [ ! -f " $Mac32DeployPath /$Mac32SetupFile " ]; then
152- echo " $Mac32SetupFile not found!"
153- exit 1
158+ Error " $Mac32SetupFile not found!"
154159 fi
155160 fi
156161
157162 if [ " $DeployWin " == " 1" ]; then
158163 if [ ! -f " $WinDeployPath /$WinUpdateFile " ]; then
159- echo " $WinUpdateFile not found!"
160- exit 1
164+ Error " $WinUpdateFile not found!"
161165 fi
162166
163167 if [ " $BetaVersion " == " 0" ]; then
164168 if [ ! -f " $WinDeployPath /$WinSetupFile " ]; then
165- echo " $WinSetupFile not found!"
166- exit 1
169+ Error " $WinSetupFile not found!"
167170 fi
168171 fi
169172
170173 if [ ! -f " $WinDeployPath /$WinPortableFile " ]; then
171- echo " $WinPortableFile not found!"
172- exit 1
174+ Error " $WinPortableFile not found!"
173175 fi
174176 fi
175177
@@ -221,4 +223,6 @@ if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ] || [ "$Build
221223 fi
222224fi
223225
224- echo " Version $AppVersionStrFull was deployed!" ;
226+ echo " Version $AppVersionStrFull was deployed!"
227+ cd $FullExecPath
228+
0 commit comments