2018-04-27 08:42:22 +02:00
|
|
|
const logger = require('winston');
|
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
const deleteFile = (filePath) => {
|
|
|
|
fs.unlink(filePath, err => {
|
|
|
|
if (err) {
|
|
|
|
return logger.error(`error deleting temporary file ${filePath}`);
|
|
|
|
}
|
2018-08-20 21:27:52 +02:00
|
|
|
logger.info(`successfully deleted ${filePath}`);
|
2018-04-27 08:42:22 +02:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = deleteFile;
|