-
Notifications
You must be signed in to change notification settings - Fork 107
/
mvrk.py
executable file
·43 lines (31 loc) · 1.12 KB
/
mvrk.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
37
38
39
40
41
42
43
#!/usr/bin/env python3
"""Maverick
Author: AlanDecode | 熊猫小A
Link: https://www.imalan.cn
GitHub: https://github.com/AlanDecode
"""
import argparse
from Maverick.Utils import print_color, Color
from Maverick.Builder import Builder
from Maverick.Config import g_conf
def _get_parser() -> argparse.ArgumentParser:
_parser = argparse.ArgumentParser()
_parser.add_argument('--config', '-c', required=True, help='Config file path')
_parser.add_argument('--source_dir', '-s', default='', help='Source dir')
_parser.add_argument('--build_dir', '-b', default='', help='Build dir')
return _parser
def main():
args = _get_parser().parse_args()
g_conf.update_fromfile(args.config)
g_conf.update_fromenv()
if args.source_dir:
g_conf.source_dir = args.source_dir
if args.build_dir:
g_conf.build_dir = args.build_dir
print_color('Site prefix: ' + g_conf.site_prefix, Color.GREEN.value)
print_color('Source dir: ' + g_conf.source_dir, Color.GREEN.value)
print_color('Build dir: ' + g_conf.build_dir, Color.GREEN.value)
builder = Builder(g_conf)
builder.build_all()
if __name__ == "__main__":
main()