qleaner 1.0.19 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/controllers/image.js +6 -5
- package/package.json +1 -1
package/controllers/image.js
CHANGED
|
@@ -145,17 +145,18 @@ async function getUnusedImages(chalk, imageDirectory, codeDirectory, options) {
|
|
|
145
145
|
let i = 0
|
|
146
146
|
let isFound = false;
|
|
147
147
|
while(!isFound && i < combinedImages.length) {
|
|
148
|
-
const imageFilePath = await resolver(
|
|
149
|
-
|
|
148
|
+
const imageFilePath = await resolver(imageDirectory, combinedImages[i].value);
|
|
149
|
+
const filePath = path.resolve(file);
|
|
150
|
+
if(compareFiles(filePath, imageFilePath)) {
|
|
150
151
|
isFound = true;
|
|
151
152
|
break;
|
|
152
153
|
}else if(i === combinedImages.length - 1) {
|
|
153
154
|
if(options.excludeFilePrint && options.excludeFilePrint.length > 0) {
|
|
154
|
-
if(!isExcludedFile(
|
|
155
|
-
unusedImages.push(
|
|
155
|
+
if(!isExcludedFile(filePath, options.excludeFilePrint)) {
|
|
156
|
+
unusedImages.push(filePath);
|
|
156
157
|
}
|
|
157
158
|
}else{
|
|
158
|
-
unusedImages.push(
|
|
159
|
+
unusedImages.push(filePath);
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
i++;
|