Copy images

This commit is contained in:
Shadowfacts 2019-09-18 10:50:13 -04:00
parent 4c3a069671
commit 0d615ccb35
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
2 changed files with 11 additions and 1 deletions

View File

@ -1,9 +1,19 @@
import { promises as fs } from "fs"; import { promises as fs } from "fs";
import * as util from "../util"; import * as util from "../util";
import * as path from "path";
export default async function copy() { export default async function copy() {
util.write("favicon.ico", await fs.readFile("site/favicon.ico")); util.write("favicon.ico", await fs.readFile("site/favicon.ico"));
util.write("favicon-152.png", await fs.readFile("site/favicon-152.png")); util.write("favicon-152.png", await fs.readFile("site/favicon-152.png"));
util.write("shadowfacts.png", await fs.readFile("site/shadowfacts.png")); util.write("shadowfacts.png", await fs.readFile("site/shadowfacts.png"));
util.write("js/comments.js", await fs.readFile("site/js/comments.js")); util.write("js/comments.js", await fs.readFile("site/js/comments.js"));
// copy images
const dirs = await fs.readdir("site/img");
for (const dir of dirs) {
const imgs = await fs.readdir(path.join("site/img", dir));
for (const img of imgs) {
util.write(path.join("img", dir, img), await fs.readFile(path.join("site/img", dir, img)));
}
}
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB