Skip to content

Commit

Permalink
Merge pull request #155 from 11ways/skip-empty-url-lines
Browse files Browse the repository at this point in the history
🐛 Skip empty url lines
  • Loading branch information
ttsukagoshi authored Nov 23, 2023
2 parents ded4094 + 2fb7bec commit 14e2188
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export default async function (options: CommandOption): Promise<void> {
const urls: string[] = fs
.readFileSync(filePath /*, { encoding: config.encoding }*/)
.toString()
.trim()
.replace(/\r?\n/g, ',')
.split(',');

Expand All @@ -71,7 +72,12 @@ export default async function (options: CommandOption): Promise<void> {
let outputText: string = raw ? '' : REPORT_HEADER.join();
const rawAxeResults: RawAxeResults = {};
for (let i = 0; i < urls.length; i++) {
const url: string = urls[i];
const url: string = urls[i].trim();

if (!url) {
continue;
}

const page: puppeteer.Page = await browser.newPage();
await page.setBypassCSP(true);
/* Emulate device: left here as a potential option for the future
Expand Down

0 comments on commit 14e2188

Please sign in to comment.