Commit 35596670 authored by nanahira's avatar nanahira

make_windbot

parent f19b7eeb
...@@ -69,6 +69,13 @@ var GitPull = function(msg) { ...@@ -69,6 +69,13 @@ var GitPull = function(msg) {
} }
runcmd("git", ["pull", "origin", branch], config.client_git_db_path, "Finished updating client data"); runcmd("git", ["pull", "origin", branch], config.client_git_db_path, "Finished updating client data");
} }
if (config.windbot_git_db_path) {
var branch = config.windbot_branch;
if (!branch) {
branch = "master";
}
runcmd("git", ["pull", "origin", branch], config.windbot_git_db_path, "Finished updating windbot");
}
} }
var copyToYGOPRO = function(msg) { var copyToYGOPRO = function(msg) {
if (!config.ygopro_path || !config.git_db_path) { if (!config.ygopro_path || !config.git_db_path) {
...@@ -111,6 +118,18 @@ var MakePro = function(msg) { ...@@ -111,6 +118,18 @@ var MakePro = function(msg) {
sendResponse("Permission denied"); sendResponse("Permission denied");
} }
} }
var MakeWindbot = function(msg) {
if (config.windbot_git_db_path) {
runcmd("xbuild", ["WindBot.sln", "/m", "/property:Configuration=Release"], config.windbot_git_db_path, "Finished pre-making", function (code) {
runcmd("make", ["config=release"], config.ygopro_path+"ygopro-temp/build/", "Finished making WindBot", function (code) {
execSync('cp -rf bin/Release/* .', { cwd: config.windbot_git_db_path, env: process.env });
sendResponse("Finished copying WindBot");
});
});
} else {
sendResponse("Permission denied");
}
}
var UpdateOCGScripts = function(msg) { var UpdateOCGScripts = function(msg) {
if (!config.ygopro_path) { if (!config.ygopro_path) {
sendResponse("Permission denied"); sendResponse("Permission denied");
...@@ -284,6 +303,11 @@ http.createServer(function (req, res) { ...@@ -284,6 +303,11 @@ http.createServer(function (req, res) {
res.end(u.query.callback+'({"message":"Started making YGOPro"});'); res.end(u.query.callback+'({"message":"Started making YGOPro"});');
MakePro(u.query.message); MakePro(u.query.message);
} }
else if (u.pathname === '/api/make_windbot') {
res.writeHead(200);
res.end(u.query.callback+'({"message":"Started making WindBot"});');
MakeWindbot(u.query.message);
}
else if (u.pathname === '/api/update_ocg_scripts') { else if (u.pathname === '/api/update_ocg_scripts') {
res.writeHead(200); res.writeHead(200);
res.end(u.query.callback+'({"message":"Updating OCG scripts"});'); res.end(u.query.callback+'({"message":"Updating OCG scripts"});');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment