We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 94b4dfd commit c6b8025Copy full SHA for c6b8025
load.ts
@@ -718,8 +718,13 @@ async function load() {
718
"tt0258000",
719
];
720
721
+ // Create the folder if it doesn't exist
722
+ const folderPath = './data/imdb';
723
+ const imdbFolderExists = await fs.stat(folderPath).then(() => true).catch(() => false);
724
+ if(!imdbFolderExists) await fs.mkdir(folderPath);
725
+
726
for (const id of ids) {
- const path = `./data/imdb/${id}.html`;
727
+ const path = `${folderPath}/${id}.html`;
728
const exists = await fs
729
.stat(path)
730
.then(() => true)
0 commit comments