Skip to content

Commit

Permalink
🐛 Try using root config 1 dir up
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Oct 28, 2020
1 parent 4b02d28 commit 209c6f9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion post-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,25 @@ export const preProcess = async () => {
await remove(join(".", "__sapper__", "export", baseUrl));
}

try {
const file = await readFile(join("..", ".upptimerc.yml"), "utf8");
if (file) {
config = safeLoad(file) as any;
console.log("Using root config instead");
}
} catch (error) {
console.log("Root config not found 1 dir up");
}

try {
const file = await readFile(join("..", "..", ".upptimerc.yml"), "utf8");
if (file) {
config = safeLoad(file) as any;
console.log("Using root config instead");
}
} catch (error) {}
} catch (error) {
console.log("Root config not found 2 dirs up");
}

if (config["status-website"] && config["status-website"].cname)
await writeFile(join(".", "__sapper__", "export", "CNAME"), config["status-website"].cname);
Expand Down

0 comments on commit 209c6f9

Please sign in to comment.