mirror of
https://github.com/wahyd4/upptime.git
synced 2026-08-14 07:36:13 +10:00
25 lines
630 B
TypeScript
25 lines
630 B
TypeScript
import { readFile, writeFile, copyFile } from "fs-extra";
|
|
import { safeLoad } from "js-yaml";
|
|
import { join } from "path";
|
|
|
|
export const preProcess = async () => {
|
|
const config = safeLoad(
|
|
await readFile(join("..", ".upptimerc.yml"), "utf8")
|
|
) as {
|
|
"status-website"?: {
|
|
cname?: string;
|
|
};
|
|
};
|
|
if (config["status-website"]?.cname)
|
|
await writeFile(
|
|
join(".", "__sapper__", "export", "CNAME"),
|
|
config["status-website"]?.cname
|
|
);
|
|
await copyFile(
|
|
join(".", "__sapper__", "export", "service-worker-index.html"),
|
|
join(".", "__sapper__", "export", "404.html")
|
|
);
|
|
};
|
|
|
|
preProcess();
|