2012-07-13 01:07:58 +00:00
|
|
|
import os, os.path, sys
|
2012-12-03 03:59:22 +00:00
|
|
|
from optparse import OptionParser
|
2012-07-13 01:07:58 +00:00
|
|
|
|
2012-08-02 07:51:51 +00:00
|
|
|
from fml import setup_fml, finish_setup_fml, apply_fml_patches, setup_mcp
|
2012-07-13 01:07:58 +00:00
|
|
|
|
2012-08-09 06:44:32 +00:00
|
|
|
def fml_main(fml_dir, mcp_dir, dont_gen_conf=True):
|
2012-07-13 01:07:58 +00:00
|
|
|
print '================ Forge ModLoader Setup Start ==================='
|
2012-08-09 06:44:32 +00:00
|
|
|
setup_mcp(fml_dir, mcp_dir, dont_gen_conf)
|
2012-07-13 01:07:58 +00:00
|
|
|
setup_fml(fml_dir, mcp_dir)
|
2012-08-04 00:32:23 +00:00
|
|
|
apply_fml_patches(fml_dir, mcp_dir, os.path.join(mcp_dir, 'src'))
|
2012-07-13 01:07:58 +00:00
|
|
|
finish_setup_fml(fml_dir, mcp_dir)
|
|
|
|
print '================ Forge ModLoader Setup End ==================='
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2012-12-03 03:59:22 +00:00
|
|
|
parser = OptionParser()
|
|
|
|
parser.add_option('-m', '--mcp-dir', action='store_true', dest='mcp_dir', help='Path to download/extract MCP to', default=None)
|
|
|
|
options, _ = parser.parse_args()
|
|
|
|
|
|
|
|
fml_dir = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
|
|
if not options.mcp_dir is None:
|
|
|
|
fml_main(fml_dir, os.path.abspath(options.mcp_dir))
|
2012-12-03 04:26:36 +00:00
|
|
|
elif os.path.isfile(os.path.join('..', 'runtime', 'commands.py')):
|
2012-12-03 03:59:22 +00:00
|
|
|
fml_main(fml_dir, os.path.abspath('..'))
|
|
|
|
else:
|
|
|
|
fml_main(fml_dir, os.path.abspath('mcp'))
|