installer - finally got it all working ;)

v1.18.x
psychobunny
parent 255e3bdd20
commit 24a11314dc

@ -96,10 +96,19 @@ function install(req, res) {
} }
function launch(req, res) { function launch(req, res) {
var pidFilePath = __dirname + '../pidfile';
res.json({}); res.json({});
server.close(); server.close();
require('child_process').fork('app', [], {});
var child = require('child_process').spawn('node', ['app.js'], {
detached: true,
stdio: ['ignore', 'ignore', 'ignore']
});
fs.writeFile(__dirname + '../pidfile', child.pid, function() {
child.unref();
process.exit(0);
});
} }
function compileLess(callback) { function compileLess(callback) {

@ -114,7 +114,11 @@ $('document').ready(function() {
$('#launch .fa-spin').removeClass('hide'); $('#launch .fa-spin').removeClass('hide');
$.post('/launch', function() { $.post('/launch', function() {
console.log('launched'); setInterval(function() {
$.get('/admin', function(data) {
window.location = 'admin';
});
}, 750);
}); });
} }
}); });
Loading…
Cancel
Save