mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-12-25 07:02:26 +01:00
website: fix missing target_dir error
This commit is contained in:
parent
565dc81994
commit
bfc22ae6dd
@ -37,8 +37,9 @@ async function shortcode_image(src, alt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function shortcode_image_url(src) {
|
async function shortcode_image_url(src) {
|
||||||
|
const target_dir = `./_site/img`;
|
||||||
const src_parsed = path.parse(src);
|
const src_parsed = path.parse(src);
|
||||||
const target = path.join(`./_site/img`, src_parsed.base);
|
const target = path.join(target_dir, src_parsed.base);
|
||||||
if(!fs.existsSync(path.dirname(target)))
|
if(!fs.existsSync(path.dirname(target)))
|
||||||
await fs.promises.mkdir(target_dir, { recursive: true });
|
await fs.promises.mkdir(target_dir, { recursive: true });
|
||||||
await fs.promises.copyFile(src, target);
|
await fs.promises.copyFile(src, target);
|
||||||
|
Loading…
Reference in New Issue
Block a user