From 209c6f943d74759bf3db3f14a2d750d608d7200b Mon Sep 17 00:00:00 2001 From: Anand Chowdhary Date: Wed, 28 Oct 2020 12:22:37 +0530 Subject: [PATCH] :bug: Try using root config 1 dir up --- post-process.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/post-process.ts b/post-process.ts index ecfe3fe..46c7eef 100644 --- a/post-process.ts +++ b/post-process.ts @@ -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);