si la conf n'existe pas on l'ouvre

This commit is contained in:
WEBER Antoine 2015-10-12 19:16:48 +02:00
parent 36838263a3
commit 858c5bd713
1 changed files with 71 additions and 49 deletions

View File

@ -13,9 +13,26 @@
if (!exists) {
console.log('Config.js a été ré-initialisé');
fs.copy('config.js_example','config.js');
}
var child_process = require('child_process');
// exec: spawns a shell.
var cp = child_process.exec('open config.js', function(error, stdout, stderr){
//var gui = require('nw.gui');
//gui.App.closeAllWindows();
//global.main_server.kill();
//gui.App.quit();
});
cp.on('exit',function(stream){
var gui = require('nw.gui');
gui.App.closeAllWindows();
//global.main_server.kill();
gui.App.quit();
});
}
else{
//lancement normal
var config = require('./config');
//Prevenir des informations de config
@ -58,8 +75,6 @@
height: 180
});
win.hide();
//lancement du serveur
var child_process = require('child_process');
global.main_server = child_process.exec('./bin/node ./js/clustering.js');
@ -68,3 +83,10 @@
process.on('exit', function (exitCode) {
child_process.kill();
});
}
});
win.hide();