-
Notifications
You must be signed in to change notification settings - Fork 2k
/
k
93 lines (83 loc) · 2.48 KB
/
k
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
_get_ziplink () {
local regex
regex='(https?)://github.com/.+/.+'
if [[ $UPSTREAM_REPO == "TelethonAr" ]]
then
echo "aHR0cHM6Ly9naXRodWIuY29tL3RlbGV0aG9uQXJhYi9BcmFiL2FyY2hpdmUvbWFzdGVyLnppcA==" | base64 -d
elif [[ $UPSTREAM_REPO =~ $regex ]]
then
if [[ $UPSTREAM_REPO_BRANCH ]]
then
echo "${UPSTREAM_REPO}/archive/${UPSTREAM_REPO_BRANCH}.zip"
else
echo "${UPSTREAM_REPO}/archive/master.zip"
fi
else
echo "aHR0cHM6Ly9naXRodWIuY29tL3RlbGV0aG9uQXJhYi9BcmFiL2FyY2hpdmUvbWFzdGVyLnppcA==" | base64 -d
fi
}
_get_repolink () {
local regex
local rlink
regex='(https?)://github.com/.+/.+'
if [[ $UPSTREAM_REPO == "TelethonAr" ]]
then
rlink=`echo "aHR0cHM6Ly9naXRodWIuY29tL3RlbGV0aG9uQXJhYi9BcmFi" | base64 -d`
elif [[ $UPSTREAM_REPO =~ $regex ]]
then
rlink=`echo "${UPSTREAM_REPO}"`
else
rlink=`echo "aHR0cHM6Ly9naXRodWIuY29tL3RlbGV0aG9uQXJhYi9BcmFi" | base64 -d`
fi
echo "$rlink"
}
_run_python_code() {
python3${pVer%.*} -c "$1"
}
_run_catpack_git() {
$(_run_python_code 'from git import Repo
import sys
OFFICIAL_UPSTREAM_REPO = "https://github.com/telethonArab/Arab"
ACTIVE_BRANCH_NAME = "master"
repo = Repo.init()
origin = repo.create_remote("temponame", OFFICIAL_UPSTREAM_REPO)
origin.fetch()
repo.create_head(ACTIVE_BRANCH_NAME, origin.refs[ACTIVE_BRANCH_NAME])
repo.heads[ACTIVE_BRANCH_NAME].checkout(True) ')
}
_run_cat_git() {
local repolink=$(_get_repolink)
$(_run_python_code 'from git import Repo
import sys
OFFICIAL_UPSTREAM_REPO="'$repolink'"
ACTIVE_BRANCH_NAME = "'$UPSTREAM_REPO_BRANCH'" or "master"
repo = Repo.init()
origin = repo.create_remote("temponame", OFFICIAL_UPSTREAM_REPO)
origin.fetch()
repo.create_head(ACTIVE_BRANCH_NAME, origin.refs[ACTIVE_BRANCH_NAME])
repo.heads[ACTIVE_BRANCH_NAME].checkout(True) ')
}
_set_bot () {
local zippath
zippath="TelethonAr11.zip"
echo "جاري تنزيل اكواد السورس "
wget -q $(_get_ziplink) -O "$zippath"
echo " تفريغ البيانات "
CATPATH=$(zipinfo -1 "$zippath" | grep -v "/.");
unzip -qq "$zippath"
echo " تم التفريغ "
echo " يتم التنظيف "
rm -rf "$zippath"
sleep 5
_run_catpack_git
cd $CATPATH
_run_cat_git
python3 ../setup/updater.py ../requirements.txt requirements.txt
chmod -R 755 bin
echo " Start TelethonAr "
echo "
"
python3 -m Arab
}
_set_bot