Autopull :>

This commit is contained in:
Flummi 2016-09-11 15:14:20 +02:00
parent 085ad0eeba
commit c3a063411b

View File

@ -4,6 +4,7 @@ var path = require('path');
var swig = require('swig'); var swig = require('swig');
var urlm = require('url'); var urlm = require('url');
var cfg = require('../cfg/websrv.json'); var cfg = require('../cfg/websrv.json');
var exec = require('child_process').exec;
var templates = {}; var templates = {};
var bot, sql, lib; var bot, sql, lib;
@ -43,6 +44,13 @@ function Websrv(tbot, tsql, tlib) {
commit = body.commits[body.commits.length-2].message.replace('\n','').trim(); commit = body.commits[body.commits.length-2].message.replace('\n','').trim();
} }
bot.send( lib.cfg.debugchannel, eventname + ' from ' + autor + ' ('+commit+')', 'n0xy' ); bot.send( lib.cfg.debugchannel, eventname + ' from ' + autor + ' ('+commit+')', 'n0xy' );
if( lib.cfg.debugchannel === '#f0ck' ) {
exec('cd ../ & git pull', (error, stdout) => {
if(error === null)
bot.send( lib.cfg.debugchannel, stdout, 'n0xy' );
});
}
}); });
res.writeHead(200, { 'Content-Type': 'text/html' }); res.writeHead(200, { 'Content-Type': 'text/html' });
res.end('muh', 'utf-8'); res.end('muh', 'utf-8');