This repository has been archived by the owner on Aug 29, 2019. It is now read-only.
forked from GnaspGames/Smelt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
moltenmgr-compile.js
69 lines (55 loc) · 2.13 KB
/
moltenmgr-compile.js
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env node
StartCompiler = require("./Compiler/StartCompiler");
FileParser = require("./Compiler/FileParser");
CommandBlock = require("./Compiler/CommandBlock");
CommandModule = require("./Compiler/CommandModule");
CommandCreator = require("./Compiler/CommandCreator");
BangCommandHelper = require("./BangCommands/Helper");
RconClient = require("./Compiler/RconClient");
Settings = require("./Configuration/Settings");
var util = require('util');
var commander = require('commander');
var chalk = require('chalk');
var Paths = require("./Tools/Paths");
var pjson = require('./package.json');
commander
.version(pjson.version)
.description(chalk.yellow("Compile .mcc modules: <path> should be the path to an .mcc file or directory containing .mcc files."))
.usage("<path> [options]")
.arguments("<path>")
.action(function (path)
{
StartCompiler.PathArg = path
})
.option('-s, --show', 'Show any combined-commands in the console.')
.option('-d, --debug', 'Show additional debug information in the console.')
.option('-c, --copy', 'Copy combined-commands to system clipboard, one at a time. This disables the writing of .oc files unless --write is also specified.')
.option('-w, --write', 'Write combined-commands to .oc files.')
.option('-a, --watch', 'Watch the file/directory and compile each time something changes.');
process.argv[1] = 'molten';
commander.parse(process.argv);
Settings.ReadConfigs();
if(commander.show)
Settings.Current.Output.ShowCompiledCommands = true;
if(commander.debug)
Settings.Current.Output.ShowDebugInfo = true;
if(commander.copy)
{
Settings.Current.Output.CopyCompiledCommands = true;
Settings.Current.Output.WriteCompiledCommandsToFile = false;
}
if(commander.write)
Settings.Current.Output.WriteCompiledCommandsToFile = true;
if(commander.watch)
StartCompiler.Watch = true;
Settings.OutputDebugInfo();
if(StartCompiler.PathArg)
{
StartCompiler.ProcessPath();
}
if(!StartCompiler.PathFound)
{
console.log(chalk.red.bold("\n [WARNING] Please enter the path to a .mcc file or directory containing .mcc files as the first argument."));
commander.outputHelp();
}
require("./Tools/VersionCheck").Query();