-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev_setup.py
More file actions
45 lines (34 loc) · 1.08 KB
/
Copy pathdev_setup.py
File metadata and controls
45 lines (34 loc) · 1.08 KB
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
"""
Sets up the dev environment after cloning.
"""
import os
import shutil
def clean() -> None:
print('Removing doc/generated')
if os.path.isdir('doc/generated'):
shutil.rmtree('doc/generated')
def generate_workspace_ini_template() -> None:
with open('workspace.ini', 'w') as fp:
print('wc3_path=!!TODO', file=fp)
print('mpqeditor_path=!!TODO', file=fp)
print('verbose=true', file=fp)
print('', file=fp)
print('extract_dir=./extract', file=fp)
print('pack_out_dir=./out', file=fp)
def set_up_docs() -> None:
print('Generating Docs')
from mapfile.docgen import gamedata, gamestrings, unit_changes
gamestrings.main()
gamedata.main()
unit_changes.main()
def main() -> None:
if not os.path.isfile('workspace.ini'):
print('workspace.ini file does not exist; generating a template')
generate_workspace_ini_template()
set_up_docs()
if __name__ == '__main__':
import sys
if 'clean' in sys.argv:
clean()
else:
main()