Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
Merge f5edb80 into f745823
Browse files Browse the repository at this point in the history
  • Loading branch information
tamarahills committed Sep 23, 2018
2 parents f745823 + f5edb80 commit e2f6c31
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions command/polly_tts.js
Expand Up @@ -323,13 +323,18 @@ var polly_tts = {
logger.debug('Entering deleteLocalFiles: ' + rootFile);
let files = glob.sync(rootFile.replace('.mp3', '*.*'));
var i = files.length;
logger.debug('There are: ' + i + ' files to delete.');
files.forEach(function(filepath) {
logger.debug('unlinking: ' + filepath);
fs.unlink(filepath, function(err) {
i--;
if (err) {
logger.error('Error deleting file: ' + filepath);
logger.error('Error is: ' + err);
callback(err);
return;
} else if (i <= 0) {
logger.debug('Calling the callback for deleting files');
callback(null);
}
});
Expand Down

0 comments on commit e2f6c31

Please sign in to comment.