mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-26 00:53:00 +00:00
website: fix missing target_dir error
This commit is contained in:
parent
565dc81994
commit
bfc22ae6dd
1 changed files with 2 additions and 1 deletions
|
@ -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 a new issue