Merge branch 'master' of https://git.baipyr.us/Baipyrus/DancingDuck
This commit is contained in:
commit
82847a9695
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
DuckRevamp/*
|
||||
server/node_modules/*
|
||||
server/node_modules/*
|
||||
gitUpdate.sh
|
|
@ -21,6 +21,7 @@ const cSave = __dirname+'/count.save';
|
|||
const http = require('http');
|
||||
const express = require('express');
|
||||
const socketio = require('socket.io');
|
||||
const { exec } = require('child_process');
|
||||
|
||||
const app = express();
|
||||
const clientPath = __dirname+'/../client';
|
||||
|
@ -30,6 +31,17 @@ app.use(express.static(clientPath));
|
|||
const server = http.createServer(app);
|
||||
const io = socketio(server);
|
||||
|
||||
app.post('/receiveUpdate', (req, res) => {
|
||||
res.status(200).json({success:true});
|
||||
let updater = exec(`sh ${__dirname}/../gitUpdate.sh`, (error, stdout, stderr) => {
|
||||
console.log(stdout);
|
||||
console.error(stderr);
|
||||
if (error !== null) {
|
||||
console.error(`exec error: ${error}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise(r => {
|
||||
setTimeout(r, ms);
|
||||
|
|
Loading…
Reference in New Issue
Block a user