diff --git a/CHANGELOG.md b/CHANGELOG.md index 004a415e..d9a0ff5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ Change log For detailed information check [Blogophon's releases on Github](https://github.com/fboes/blogophon/releases). +1.4.2 +----- + +* :pill: Fixed broken image generator + 1.4.1 ----- diff --git a/lib/generator.js b/lib/generator.js index cc32a2a3..8846457c 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -190,7 +190,7 @@ const Generator = function(config) { } // Target directory let sourceDirectory = post.filename.replace(/\.md$/, '') + "/"; // Source directory - let sourceGlob = glob.sync(sourceDirectory + "(*.png|*.jpg|*.gif)"); + let sourceGlob = glob.sync(sourceDirectory + "*.{png,jpg,gif}"); let sourceReg = new RegExp(sourceDirectory); let imageStyles = sourceGlob ? post.getAllImagesWithStyleObject() : {}; @@ -238,8 +238,10 @@ const Generator = function(config) { Promise .all(promises) .then(function() { - console.log("Copied "+promises.length+" attachment file(s)"); - return resolve(promises.length); + if (promises.length > 0) { + console.log("Copied "+promises.length+" attachment file(s)"); + return resolve(promises.length); + } }) .catch(reject) ;