docs: ....why wasn't this a problem *years* ago?

This commit is contained in:
Starbeamrainbowlabs 2023-12-26 12:22:57 +00:00
parent 78e30f78a8
commit 259b332883
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -118,6 +118,8 @@ async function picture(source_image, alt, target_dir, urlpath, formats = "__AUTO
} }
const target_original = path.join(target_dir, source_parsed.base); const target_original = path.join(target_dir, source_parsed.base);
if (!fs.existsSync(path.dirname(target_original)))
await fs.promises.mkdir(path.dirname(target_original), { recursive: true });
await fs.promises.copyFile(source_image, target_original); await fs.promises.copyFile(source_image, target_original);
const sources = await Promise.all(formats.map(async (format) => { const sources = await Promise.all(formats.map(async (format) => {