Skip to content

Commit eae1dd4

Browse files
committed
The fetchFile API fileConfig can pass in non-existing path
1 parent 4417055 commit eae1dd4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ export default class XCrawl {
158158
const saveFileArr: Promise<void>[] = []
159159
const saveFileErrorArr: { message: string; valueOf: () => number }[] = []
160160

161+
if (!fs.existsSync(fileConfig.storeDir)) {
162+
fs.mkdirSync(fileConfig.storeDir)
163+
}
164+
161165
function handleResItem(requestResItem: IRequestResItem) {
162166
const { id, headers, data } = requestResItem
163167

0 commit comments

Comments
 (0)