api/controllers/CommandsController.js
/**
 * Internal function to clean the server.
 * Removes a list of files, in this case the list will contain only the one file
 * created before.
 */
Internal function to clean the server.
Removes a list of files, in this case the list will contain only the one file
created before.
Internal function to clean the server . Removes a list of files in this case the list will contain only the one file created before .
function removeFIle(newFileName) {
  let arrayToRemove = [];
  arrayToRemove.push(newFileName.concat('.txt'));
  console.log('\n## Remove File:' + newFileName);
  arrayToRemove.forEach(
      element => {fs.unlink(`${PROJECT_PATH}temp/${element}`, (err) => {
        if (err) {
          console.error('Error deleting temp_file! ' + element);
        }
        console.log(`File deleted! : ${element}`);
      })});
}
function removeFIle ( newFileName ) { let arrayToRemove = [ ] ; arrayToRemove . push ( newFileName . concat ( '.txt' ) ) ; console . log ( '\n## Remove File:' + newFileName ) ; arrayToRemove . forEach ( element => { fs . unlink ( ` ${ PROJECT_PATH } ${ element } ` , ( err ) => { if ( err ) { console . error ( 'Error deleting temp_file! ' + element ) ; } console . log ( ` ${ element } ` ) ; } ) } ) ; }
Internal function to clean the server.
Internal function to clean the server .