forked from Irrelon/ige
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployPrototype.js
37 lines (31 loc) · 1.2 KB
/
deployPrototype.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
var fs = require('fs'),
exec = require('child_process').exec,
dir = '../ige_prototype/examples/',
data = {};
fs.readdir(dir, function(err, files){
if (err) { throw(err); }
files.forEach(function(file){
console.log('Reading ' + dir + file);
fs.stat(dir + file, function(err, stats){
if (err) { throw(err); }
if (stats.isDirectory()) {
// Check if the directory has a ClientConfig.js file
// so we know it's a game folder
fs.stat(dir + file + '/ClientConfig.js', function (err, ccStat) {
if (!err) {
// Folder is a game folder
console.log('Processing ' + file + '...');
var child = exec('node ./server/ige -fixPaths true -index true -deploy -proto ' + dir + file, {cwd: process.cwd()}, function (error, stdout, stderr) {
console.log('Deploy to ' + file + ' complete');
});
}
});
}
});
});
});
// TODO: Scan code in blank_game and update paths to change /ige to /ige_prototype
// Generate the obfuscated deployment
var child = exec('node ./server/ige -proto true -clearClasses true -deploy . -to ../ige_prototype/engine/core', {cwd: process.cwd()}, function (error, stdout, stderr) {
console.log('IGE Core Prototype Version Deployment Complete!');
});