Skip to content

Commit

Permalink
♻️ Add base URL in config
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Nov 23, 2020
1 parent 27d0cee commit 1c932ce
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pre-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,19 @@ export const preProcess = async () => {
let config: {
logoUrl?: string;
name?: string;
owner: string;
repo: string;
introTitle?: string;
introMessage?: string;
path: string;
i18n?: { [index: string]: string };
"status-website"?: {
cname?: string;
};
} = safeLoad(await readFile(join("..", ".upptimerc.yml"), "utf8")) as any;

if (!config.owner || !config.repo) throw new Error("Owner/repo not set");
config.path = `https://${config.owner}.github.io/${config.repo}/`;
if (config["status-website"]?.cname) config.path = `https://${config["status-website"].cname}`;
config.i18n = { ...i18n, ...config.i18n };
await ensureDir(join(".", "src", "data"));
await writeJson(join(".", "src", "data", "config.json"), config);
Expand Down

0 comments on commit 1c932ce

Please sign in to comment.