forked from MageStudio/Mage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwage
39 lines (35 loc) · 1011 Bytes
/
wage
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
#!/usr/bin/env node
"use strict"
function printIntro() {
console.log("\n\n\n--- Wage is a wannabe Game Engine. ---");
console.log("written by Marco Stagni, thanks MrDoob.");
console.log("----- < http://marcostagni.com > -----\n\n\n");
}
function printUsage() {
console.log("USAGE: wage create <projectName>".blue);
console.log("USAGE: wage serve <port>".blue);
}
var builder = require("./builder.js"),
server = require('./simplehttpserver.js'),
colors = require('colors');
if (process.argv.length > 2) {
printIntro();
var command = process.argv[2];
if (command == "create") {
var location = process.argv[3];
if (location) {
builder.create(location)
} else {
console.log('Please provide a location for the project'.red);
printUsage();
}
} else if (command == 'serve') {
var port = process.argv[3] ? process.argv[3] : 8000;
server.start(port);
} else{
console.log("Sorry, only create and serve methods avaible right now.".red);
printUsage();
}
} else {
printUsage();
}