diff --git a/src/commands/run.ts b/src/commands/run.ts index 78b0c52..feb73cd 100644 --- a/src/commands/run.ts +++ b/src/commands/run.ts @@ -56,6 +56,7 @@ export default async function (options: CommandOption): Promise { const urls: string[] = fs .readFileSync(filePath /*, { encoding: config.encoding }*/) .toString() + .trim() .replace(/\r?\n/g, ',') .split(','); @@ -71,7 +72,12 @@ export default async function (options: CommandOption): Promise { 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