Skip to content

Commit 31b363a

Browse files
further code cleanup - 2
1 parent be623f6 commit 31b363a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/lib/screenshot.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ function isImage(buffer: Buffer): boolean {
177177

178178
export async function uploadScreenshots(ctx: Context): Promise<void> {
179179
const allowedExtensions = ctx.options.fileExtension.map(ext => `.${ext.trim().toLowerCase()}`);
180-
const ignorePatterns = ctx.options.ignorePattern.map(pattern => pattern.trim().toLowerCase());
181180
let noOfScreenshots = 0;
182181

183182
async function processDirectory(directory: string, relativePath: string = ''): Promise<void> {
@@ -188,7 +187,7 @@ export async function uploadScreenshots(ctx: Context): Promise<void> {
188187
const stat = fs.statSync(filePath);
189188
const relativeFilePath = path.join(relativePath, file);
190189

191-
if (stat.isDirectory() && ignorePatterns.some(pattern => relativeFilePath.includes(pattern))) {
190+
if (if (stat.isDirectory() && ctx.options.ignorePattern.includes(relativeFilePath))) {
192191
ctx.log.debug(`Ignoring Directory ${relativeFilePath}`)
193192
continue; // Skip this path
194193
}

0 commit comments

Comments
 (0)