forked from AmiyaBot/Amiya-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_build.py
36 lines (26 loc) · 799 Bytes
/
run_build.py
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
# -*- coding: UTF-8 -*-
import sys
def argv(name, formatter=str):
key = f'--{name}'
if key in sys.argv:
index = sys.argv.index(key) + 1
if index >= len(sys.argv):
return True
if sys.argv[index].startswith('--'):
return True
else:
return formatter(sys.argv[index])
if __name__ == '__main__':
build_type = argv('type')
if build_type == 'package':
from build.package import build
build(
argv('version'),
argv('folder') or 'package',
argv('branch'),
argv('force'),
argv('upload')
)
elif build_type == 'plugins':
from pluginsDev.buildPlugins import build
build(argv('folder') or 'plugins', argv('upload'))