2015-09-24 10:49:06 +00:00
while IFS = '' read -r line || [ [ -n " $line " ] ] ; do
set $line
eval $1 = " $2 "
done < Version
2015-09-24 14:17:53 +00:00
AppVersionStrFull = " $AppVersionStr "
2015-02-05 15:03:03 +00:00
DevParam = ''
if [ " $DevChannel " != "0" ] ; then
2015-09-24 14:17:53 +00:00
AppVersionStrFull = " $AppVersionStr .dev "
2015-02-05 15:03:03 +00:00
DevParam = '-dev'
fi
2015-06-25 18:04:40 +00:00
if [ -d " ./../Linux/Release/deploy/ $AppVersionStrMajor / $AppVersionStr .dev " ] ; then
2015-02-05 15:03:03 +00:00
echo " Deploy folder for version $AppVersionStr .dev already exists! "
exit 1
fi
2014-07-14 05:16:21 +00:00
2015-06-25 18:04:40 +00:00
if [ -d " ./../Linux/Release/deploy/ $AppVersionStrMajor / $AppVersionStr " ] ; then
2014-07-14 05:16:21 +00:00
echo " Deploy folder for version $AppVersionStr already exists! "
exit 1
fi
2014-07-17 09:42:06 +00:00
if [ -f " ./../Linux/Release/tlinux32upd $AppVersion " ] ; then
2014-07-14 05:16:21 +00:00
echo " Update file for version $AppVersion already exists! "
exit 1
fi
2014-07-14 13:58:10 +00:00
if [ ! -f "./../Linux/Release/Telegram" ] ; then
2014-07-14 05:16:21 +00:00
echo "Telegram not found!"
exit 1
fi
2014-07-14 13:58:10 +00:00
if [ ! -f "./../Linux/Release/Updater" ] ; then
2014-07-14 05:16:21 +00:00
echo "Updater not found!"
exit 1
fi
2015-09-24 14:17:53 +00:00
echo " Preparing version $AppVersionStrFull , executing Packer.. "
2015-02-05 15:03:03 +00:00
cd ./../Linux/Release && ./Packer -path Telegram -path Updater -version $AppVersion $DevParam && cd ./../../Telegram
2014-07-14 05:16:21 +00:00
echo "Packer done!"
2014-07-14 13:58:10 +00:00
if [ ! -d "./../Linux/Release/deploy" ] ; then
mkdir "./../Linux/Release/deploy"
2014-07-14 05:16:21 +00:00
fi
2015-06-25 18:04:40 +00:00
if [ ! -d " ./../Linux/Release/deploy/ $AppVersionStrMajor " ] ; then
mkdir " ./../Linux/Release/deploy/ $AppVersionStrMajor "
fi
2015-09-24 14:17:53 +00:00
echo " Copying Telegram, Updater and tlinux32upd $AppVersion to deploy/ $AppVersionStrMajor / $AppVersionStrFull .. " ;
mkdir " ./../Linux/Release/deploy/ $AppVersionStrMajor / $AppVersionStrFull "
mkdir " ./../Linux/Release/deploy/ $AppVersionStrMajor / $AppVersionStrFull /Telegram "
mv ./../Linux/Release/Telegram ./../Linux/Release/deploy/$AppVersionStrMajor /$AppVersionStrFull /Telegram/
mv ./../Linux/Release/Updater ./../Linux/Release/deploy/$AppVersionStrMajor /$AppVersionStrFull /Telegram/
mv ./../Linux/Release/tlinux32upd$AppVersion ./../Linux/Release/deploy/$AppVersionStrMajor /$AppVersionStrFull /
cd ./../Linux/Release/deploy/$AppVersionStrMajor /$AppVersionStrFull && tar -cJvf tsetup32.$AppVersionStrFull .tar.xz Telegram/ && cd ./../../../../../Telegram
echo " Version $AppVersionStrFull prepared! " ;
2014-07-14 05:16:21 +00:00