Skip to content

Commit d826b1c

Browse files
committed
chore: update scripts
1 parent d8eed98 commit d826b1c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

scripts/fetch-test-data.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ async function fetchGitHubTree(
4343
async function downloadFile(url: string, localPath: string) {
4444
try {
4545
// Check if file already exists
46-
const file = Bun.file(localPath)
47-
const exists = await file.exists()
46+
const exists = await Bun.file(localPath).exists()
4847

4948
if (exists) {
5049
return { path: localPath, success: true, skipped: true }

scripts/process-test-data.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ async function traverse(inDir: string, outDir: string) {
9595
if (entry.isDirectory()) {
9696
await traverse(inPath, outPath)
9797
} else if (entry.isFile()) {
98+
const exists = await Bun.file(outPath).exists()
99+
100+
if (exists) {
101+
console.log(`Skipped: ${relativePath} (already exists)`)
102+
continue
103+
}
104+
98105
if (entry.name.endsWith('.json')) {
99106
await processJson(inPath, outPath)
100107
console.log(`Processed: ${relativePath}`)
@@ -121,4 +128,4 @@ async function main(host?: string) {
121128
}
122129
}
123130

124-
await main('epicurious.com')
131+
await main('simplyrecipes.com')

0 commit comments

Comments
 (0)