If no cache file is found, just exit.

This commit is contained in:
Will O'Beirne 2018-03-20 12:15:18 -04:00
parent 937cc3fde5
commit 847ebf340f
No known key found for this signature in database
GPG Key ID: 44C190DB5DEAF9F6
1 changed files with 4 additions and 2 deletions

View File

@ -13,10 +13,12 @@ SortCachePlugin.prototype.apply = function(compiler) {
const cacheFilePaths = klawSync(buildDir, { filter: findCacheFile });
if (!cacheFilePaths.length) {
throw new Error('Could not find .cache file');
console.warn('No cache icon cache file found for sorting.');
return;
}
if (cacheFilePaths.length > 1) {
throw new Error('More than one possible .cache file detected');
throw new Error('More than one possible icon .cache file detected', cacheFilePaths);
}
const cacheFilePath = cacheFilePaths[0].path;