Skip to content

Commit

Permalink
fixing duplicate output folder names
Browse files Browse the repository at this point in the history
  • Loading branch information
BatMiles committed Sep 23, 2024
1 parent 8672cac commit 0b3a102
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ if (!fs.existsSync(join(__dirname, outDir))) {
for (let url of urlsList) {
console.log(`Scanning ${url} ...`);
const urlObj = new URL(url);
const folderStructure = `${outDir}/${urlObj.hostname}`;
let folderStructure = `${outDir}/${urlObj.hostname}`;

if (fs.existsSync(join(__dirname, folderStructure))) {
const timestamp = Date.now();
folderStructure += `-${timestamp}`;
}

const config = {
headless: true,
outDir: join(__dirname, folderStructure),
Expand Down

0 comments on commit 0b3a102

Please sign in to comment.