Skip to content

Commit

Permalink
Merge pull request #21 from paceaux/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
paceaux authored Sep 20, 2023
2 parents c5d0d3e + 1b11d61 commit d814053
Show file tree
Hide file tree
Showing 5 changed files with 253 additions and 35 deletions.
13 changes: 13 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ function getFormattedResult(result, hasElementDetails, hasElementHtml) {
async function main(config) {
const outputter = new Outputter(DEFAULT_OUTPUT_FILE, log);
let mainConfig = { ...config };
if (!mainConfig.sitemap) {
await log.toConsole('No sitemap provided. Exiting.');
await log.errorToFileAsync('No sitemap provided. Exiting.');
return;
}
try {
const startMessage = `
| Looking...
Expand Down Expand Up @@ -219,6 +224,14 @@ ${mainConfig.useExportedSitemap ? '' : '| Ignore any existing .sitemap.json file
`);
}

if (siteCrawler.linkSet.size === 0) {
const noLinksMessage = `
||-> No links found. Nothing To search.`;
await log
.toConsole(noLinksMessage)
.infoToFileAsync(noLinksMessage);
return;
}
mainConfig.siteCrawler = siteCrawler;

const selectorFinder = new SelectorFinder(mainConfig);
Expand Down
Loading

0 comments on commit d814053

Please sign in to comment.