forked from Deadrik/TFCraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
38 lines (26 loc) · 1.09 KB
/
setup.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
import os, os.path, sys
import urllib, zipfile
import shutil, glob, fnmatch
import subprocess, logging
forge_dir = os.path.dirname(os.path.abspath(__file__))
mcp_dir = os.path.abspath('..')
src_dir = os.path.join(mcp_dir, 'src')
sys.path.append(mcp_dir)
from base import apply_patches, copytree
def main():
print '=================================== Setup Start ================================='
if not os.path.isdir(src_dir):
print 'Something went wrong, src folder not found at: %s' % src_dir
sys.exit(1)
os.chdir(forge_dir)
base_dir = os.path.join(mcp_dir, 'src_base')
work_dir = os.path.join(mcp_dir, 'src')
if os.path.isdir(base_dir):
shutil.rmtree(base_dir)
print 'Setting up source directories'
shutil.copytree(src_dir, base_dir)
print 'Applying TFC patches'
apply_patches(os.path.join(forge_dir, 'patches'), work_dir)
print '=================================== Setup Finished ================================='
if __name__ == '__main__':
main()