@ -9,8 +9,6 @@ const fs = require('fs'),
// own modules
// own modules
utils = require ( "./lib/utils" ) ,
utils = require ( "./lib/utils" ) ,
prepro = require ( "./lib/preprocessor" ) ,
prepro = require ( "./lib/preprocessor" ) ,
// cleanup
clean = utils . Cleanup ( cleanup ) ,
// args
// args
args = require ( 'args-parser' ) ( process . argv ) , // create an args parser
args = require ( 'args-parser' ) ( process . argv ) , // create an args parser
// config file
// config file
@ -163,6 +161,9 @@ function getMount(uri) {
return false ;
return false ;
}
}
/ * *
* A cleanup - function that should only be called on process exit
* /
function cleanup ( ) {
function cleanup ( ) {
logger . info ( 'Cleanup...' ) ;
logger . info ( 'Cleanup...' ) ;
prepro . cleanup ( ) ; // cleanup the preprocessor
prepro . cleanup ( ) ; // cleanup the preprocessor
@ -171,6 +172,7 @@ function cleanup() {
// Executing the main function
// Executing the main function
if ( typeof require !== 'undefined' && require . main === module ) {
if ( typeof require !== 'undefined' && require . main === module ) {
utils . Cleanup ( cleanup ) ; // set the cleanup function
logger . exceptions . handle (
logger . exceptions . handle (
new winston . transports . File ( {
new winston . transports . File ( {
filename : './.log/frontserver-exceptions.log'
filename : './.log/frontserver-exceptions.log'