Commit 66dbb5c9 authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[BUGFIX] resolve _optimize task early if no images have been found

parent 0d098c77
...@@ -100,6 +100,10 @@ module.exports = class Images extends Task { ...@@ -100,6 +100,10 @@ module.exports = class Images extends Task {
*/ */
async _optimize(_files, _imagesPath) { async _optimize(_files, _imagesPath) {
return new Promise(async (_resolve) => { return new Promise(async (_resolve) => {
if (_files.length === 0) {
this._logger.success(`No images found in ${_imagesPath}. Moving on.`);
_resolve();
}
if (!this._embedded) { if (!this._embedded) {
this._loadingSpinner = ora(); this._loadingSpinner = ora();
this._loadingSpinner.start(`Optimizing images...`); this._loadingSpinner.start(`Optimizing images...`);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment